{"id":25745749,"url":"https://github.com/gapitio/grafana-metric","last_synced_at":"2026-05-15T06:35:00.572Z","repository":{"id":42694768,"uuid":"307627295","full_name":"gapitio/grafana-metric","owner":"gapitio","description":"Retrieves metric value from Grafana's data interface.","archived":false,"fork":false,"pushed_at":"2023-06-15T11:39:45.000Z","size":951,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-06T06:49:27.078Z","etag":null,"topics":["gapit-htmlgraphics-panel","grafana","metric","retrieves-metric","utility"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/gapitio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2020-10-27T08:03:57.000Z","updated_at":"2024-12-09T17:52:36.000Z","dependencies_parsed_at":"2024-11-14T13:19:36.790Z","dependency_job_id":"c9374c2c-72b5-45b7-a58b-ef6c1de161b2","html_url":"https://github.com/gapitio/grafana-metric","commit_stats":{"total_commits":73,"total_committers":5,"mean_commits":14.6,"dds":0.2191780821917808,"last_synced_commit":"fa8495fdfca71b4889133f99ce0fc63673e68aaa"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":"gapitio/utility-template","purl":"pkg:github/gapitio/grafana-metric","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gapitio%2Fgrafana-metric","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gapitio%2Fgrafana-metric/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gapitio%2Fgrafana-metric/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gapitio%2Fgrafana-metric/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gapitio","download_url":"https://codeload.github.com/gapitio/grafana-metric/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gapitio%2Fgrafana-metric/sbom","scorecard":{"id":418557,"data":{"date":"2025-08-11","repo":{"name":"github.com/gapitio/grafana-metric","commit":"fa8495fdfca71b4889133f99ce0fc63673e68aaa"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.7,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":3,"reason":"Found 5/14 approved changesets -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/build.yml:1","Warn: no topLevel permission defined: .github/workflows/lint.yml:1","Warn: no topLevel permission defined: .github/workflows/publish.yml:1","Warn: no topLevel permission defined: .github/workflows/test.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":3,"reason":"dependency not pinned by hash detected -- score normalized to 3","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/gapitio/grafana-metric/build.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/gapitio/grafana-metric/build.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/lint.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/gapitio/grafana-metric/lint.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/lint.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/gapitio/grafana-metric/lint.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/gapitio/grafana-metric/publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/gapitio/grafana-metric/publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/gapitio/grafana-metric/test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/gapitio/grafana-metric/test.yml/main?enable=pin","Info:   0 out of   8 GitHub-owned GitHubAction dependencies pinned","Info:   4 out of   4 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 26 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"17 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-hqq7-2q2v-82xq","Warn: Project is vulnerable to: GHSA-q8gg-vj6m-hgmj","Warn: Project is vulnerable to: GHSA-3j9m-hcv9-rpj8","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-5v2h-r2cx-5xgj","Warn: Project is vulnerable to: GHSA-rrrm-qjm4-v8hf","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T00:34:28.966Z","repository_id":42694768,"created_at":"2025-08-19T00:34:28.966Z","updated_at":"2025-08-19T00:34:28.966Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":285382216,"owners_count":27162161,"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","status":"online","status_checked_at":"2025-11-20T02:00:05.334Z","response_time":54,"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":["gapit-htmlgraphics-panel","grafana","metric","retrieves-metric","utility"],"created_at":"2025-02-26T11:19:12.793Z","updated_at":"2025-11-20T06:04:38.624Z","avatar_url":"https://github.com/gapitio.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HTMLGraphics metric\n\nRetrieves metric value from Grafana's [data interface](https://grafana.com/docs/grafana/latest/packages_api/data/paneldata/).\n\n## Usage\n\nThe main difference between MetricValue and MetricData is that MetricValue is a single value while MetricData is an object\n\n```ts\ntype MetricValue = unknown;\n\ninterface TimeData {\n  first?: unknown;\n  last?: unknown;\n}\n\ninterface MetricData {\n  calcs: { [key: string]: unknown };\n  time: TimeData;\n  hasData: boolean;\n}\n```\n\n### getMetricValueFromExpression\n\nEvaluates a metric expression\n\n```ts\nimport { getMetricValueFromExpression } from \"@gapit/grafana-metric\";\n\n// random-metric = 100\n\ngetMetricValueFromExpression(\"'random-metric' * 2\"); // Returns 200\ngetMetricValueFromExpression(\"Math.sqrt('random-metric')\"); // Returns 10\n```\n\n### getShowcaseMetricValue\n\nGenerate a random number\n\n```ts\nimport { getShowcaseMetricValue } from \"@gapit/grafana-metric\";\n\ngetShowcaseMetricValue(); // Returns a value between 0 and 1000 with 2 decimals\ngetShowcaseMetricValue({ range: { min: x, max: y }, decimals: z }); // Return a random value between x and y with z decimals.\n```\n\n### getMetricValueFromName\n\nGets a metric value by name/alias\n\n```ts\nimport { getMetricValueFromName } from \"@gapit/grafana-metric\";\n\n// metric-name = 100\n\ngetMetricValueFromName(\"metric-name\"); // Returns 100\ngetMetricValueFromName(\"non-existing-metric\"); // Returns null\ngetMetricValueFromName(\"non-existing-metric\", { noDataValue: \"No data\" }); // Returns \"No data\"\n```\n\n### getMetricValue\n\nFunction provides calculations for grafana queries.\n\n```ts\nimport { getMetricValue } from \"@gapit/grafana-metric\";\n\n// metric-name = 100\n\n// From name\ngetMetricValue(\"metric-name\"); // Returns 100\n\n// No data\ngetMetricValue(\"non-existing-metric\"); // Returns null\ngetMetricValue(\"non-existing-metric\", { noDataValue: \"No data\" }); // Returns \"No data\"\n\n// Evaluation string\ngetMetricValue(\"'metric-name' * 2\"); // Returns 200\ngetMetricValue(\"Math.sqrt('metric-name')\"); // Returns 10\n\n// Showcase\ngetMetricValue(\"metric-name\", { showcase: true }); // Returns a random value between 0 and 1000.\ngetMetricValue(\"metric-name\", { showcase: true, range: { min: 0, max: 10 } }); // Returns random value between 1-10.\ngetMetricValue(\"metric-name\", {\n  showcase: true,\n  range: { min: 0, max: 10 },\n  decimals: 4,\n}); // Returns random value between 1-10 with 4 decimals.\n```\n\n### getMetricDataFromExpression\n\nEvaluates a metric expression\n\n### getShowcaseMetricData\n\nGenerates a random metric data object\n\n### getMetricDataFromName\n\nGets metric data by name/alias\n\n### getMetricData\n\nGets metric data\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgapitio%2Fgrafana-metric","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgapitio%2Fgrafana-metric","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgapitio%2Fgrafana-metric/lists"}