{"id":21344497,"url":"https://github.com/s00d/nuxt-prometheus-exporter","last_synced_at":"2025-03-16T03:21:47.134Z","repository":{"id":196832909,"uuid":"697238042","full_name":"s00d/nuxt-prometheus-exporter","owner":"s00d","description":null,"archived":false,"fork":false,"pushed_at":"2023-09-27T14:44:29.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-03T02:33:59.406Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/s00d.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-27T10:28:18.000Z","updated_at":"2023-09-27T10:29:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"df404e5f-e9e8-4c73-8002-0c77d949e339","html_url":"https://github.com/s00d/nuxt-prometheus-exporter","commit_stats":null,"previous_names":["s00d/nuxt-prometheus-exporter"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s00d%2Fnuxt-prometheus-exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s00d%2Fnuxt-prometheus-exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s00d%2Fnuxt-prometheus-exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s00d%2Fnuxt-prometheus-exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/s00d","download_url":"https://codeload.github.com/s00d/nuxt-prometheus-exporter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243819312,"owners_count":20352868,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-22T01:19:24.643Z","updated_at":"2025-03-16T03:21:47.116Z","avatar_url":"https://github.com/s00d.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NUXT Prometheus Exporter\n\nNUXT Prometheus exporter makes it possible to monitor NUXT using Prometheus.\n\n\n## Getting Started\n\n\n1. download latest version from release\n2. runas service\n\n```bash\n[Unit]\nDescription=NUXT Prometheus Exporter\nAfter=network.target\n\n[Service]\nUser=nuxt-exp\nGroup=nuxt-exp\n\nExecStart=/usr/local/bin/nuxt-prometheus-exporter\n```\n\n3. add server middleware to nuxt `server-middleware/prometheus.js`, example with axios\n\n```js\nimport axios from 'axios';\n\nexport default function (req, res, next) {\n  const start = +new Date();\n  res.once('finish', () =\u003e {\n    const end = +new Date();\n    axios.post('http://localhost:45555/nodejs-requests', {\n      route: req._parsedUrl.pathname ?? req.originalUrl,\n      code: res.statusCode.toString(),\n      method: req.method,\n      date: start.toString(),\n      duration: (end - start).toString(),\n    }, {\n      headers: {\n        'Content-Type': 'application/json',\n      },\n    });\n  });\n  next();\n}\n```\n\nall values must be string\n\nby analogy, can be used with any other project\n\n4. enable server middleware in `nuxt.config.js`\n\n```js\n{\n    // ...\n    serverMiddleware: [\n        // ...\n        '~/server-middleware/prometheus',\n        // ...\n    ]\n    // ...\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fs00d%2Fnuxt-prometheus-exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fs00d%2Fnuxt-prometheus-exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fs00d%2Fnuxt-prometheus-exporter/lists"}