{"id":51038665,"url":"https://github.com/valamidev/grafana-cloud-graphite","last_synced_at":"2026-06-22T09:00:42.547Z","repository":{"id":198652436,"uuid":"699409003","full_name":"valamidev/grafana-cloud-graphite","owner":"valamidev","description":"NPM package client for grafana-cloud graphite metrics","archived":false,"fork":false,"pushed_at":"2024-04-28T15:17:50.000Z","size":466,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-26T07:26:04.816Z","etag":null,"topics":["grafana","grafana-cloud","graphite"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/grafana-cloud-graphite","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/valamidev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-10-02T15:18:35.000Z","updated_at":"2024-04-28T15:17:54.000Z","dependencies_parsed_at":"2024-04-28T16:25:51.444Z","dependency_job_id":"eac89911-cc55-481b-802a-e7e608019b04","html_url":"https://github.com/valamidev/grafana-cloud-graphite","commit_stats":null,"previous_names":["valamidev/grafana-cloud-graphite"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/valamidev/grafana-cloud-graphite","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valamidev%2Fgrafana-cloud-graphite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valamidev%2Fgrafana-cloud-graphite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valamidev%2Fgrafana-cloud-graphite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valamidev%2Fgrafana-cloud-graphite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/valamidev","download_url":"https://codeload.github.com/valamidev/grafana-cloud-graphite/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/valamidev%2Fgrafana-cloud-graphite/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34641636,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-22T02:00:06.391Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["grafana","grafana-cloud","graphite"],"created_at":"2026-06-22T09:00:28.456Z","updated_at":"2026-06-22T09:00:42.498Z","avatar_url":"https://github.com/valamidev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Grafana Cloud Graphite Metrics Client\n\nThis package provides a simple way to send metrics to a Grafana Cloud Graphite server. It includes support for counters and interval metrics.\n\n#### Provide easy use for:\n\nhttps://grafana.com/docs/grafana-cloud/monitor-infrastructure/metrics/metrics-graphite/http-api/\n\n### Example Grafana Dashboard feeded by this package\n\n![Dashboard Screenshot Example](https://github.com/valamidev/grafana-cloud-graphite/blob/main/docs/screenshot.webp)\n\n### Installation\n\nTo install this package, use npm:\n\n```bash\nnpm i grafana-cloud-graphite\n```\n\n### Requirements\n\n- Grafana Cloud: [Get free account](https://grafana.com/auth/sign-up?refCode=gr8zEPmXdDewWfA)\n\n- Grafana Access Token(metrics:write): https://grafana.com/orgs/YOUR_ORGS/access-policies\n\n- Grafana Graphite UserId: https://grafana.com/orgs/YOUR_ORGS\n\n### Usage\n\nTo use this package, first import the GraphiteMetrics class:\n\n```javascript\nimport { GraphiteMetrics } from \"grafana-cloud-graphite\";\n```\n\nThen, create a new instance of the class with your Graphite server options:\n\n```javascript\nconst Metrics = new GraphiteMetrics({\n  userId: \"5435231\", // Grafana Graphite UserId\n  token: \"glc_kyupkp...\", // Grafana Access Token\n  ingestEndpointURL: \"https://something.grafana.net/graphite/metrics\",\n  namespace: \"e2e\",\n});\n\n// Handle/Listen Metrics error\nMetrics.on(\"error\", (err) =\u003e {\n  console.error(err);\n});\n```\n\nYou can then register counters and interval metrics with the `registerCounter` method:\n\n```javascript\n// Register a counter metric with 60.000ms (1 minute) reporting interval\nconst dbCounterAll = Metrics.registerCounter(\"db.query.all\", 60000);\nconst dbCounterError = Metrics.registerCounter(\"db.query.error\", 60000);\n```\n\nUse counter example:\n\n```javascript\ntry {\n  dbCounterAll.inc();\n  await db.query(\"SELECT * FROM users\");\n  // do some DB query\n} catch (error) {\n  dbCounterError.inc();\n  // some error handling\n}\n```\n\nTo stop reporting metrics / clearIntervals, call the stop method:\n\n```javascript\nMetrics.stop();\n```\n\n### Additional Metrics types\n\n```javascript\n// Register a counter metric with 60.000ms (1 minute) reporting interval\nconst dbQueryTime = Metrics.registerStats(\"db.query.time\", 60000);\n\ndbCounterTime.add(100);\ndbCounterTime.add(100);\ndbCounterTime.add(200);\n/* Result:\ndb.query.time.min: 100, \ndb.query.time.max: 200, \ndb.query.time.avg: 133\ndb.query.time.median: 100\n*/\n\nconst gauge = Metrics.registerGauge(\"any.gauge\", 60000);\n\ngauge.inc(100);\ngauge.dec(50);\n// Result any.gauge: 50\n```\n\n### Use metrics on Grafana Dashboard\n\n![Dashboard Screenshot Example](./docs/screenshot.webp)\n\n### License\n\nThis package is licensed under the MIT License. See the LICENSE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalamidev%2Fgrafana-cloud-graphite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvalamidev%2Fgrafana-cloud-graphite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvalamidev%2Fgrafana-cloud-graphite/lists"}