{"id":23695573,"url":"https://github.com/simplaex/metrics","last_synced_at":"2025-09-15T02:33:15.702Z","repository":{"id":144533490,"uuid":"237240287","full_name":"simplaex/metrics","owner":"simplaex","description":null,"archived":false,"fork":false,"pushed_at":"2020-10-13T23:20:55.000Z","size":59,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-07-29T18:49:27.618Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simplaex.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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,"zenodo":null}},"created_at":"2020-01-30T15:15:26.000Z","updated_at":"2020-10-13T23:20:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"8a605e10-f21d-41ce-accf-5d9cb7ca324f","html_url":"https://github.com/simplaex/metrics","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/simplaex/metrics","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplaex%2Fmetrics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplaex%2Fmetrics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplaex%2Fmetrics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplaex%2Fmetrics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simplaex","download_url":"https://codeload.github.com/simplaex/metrics/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplaex%2Fmetrics/sbom","scorecard":{"id":825478,"data":{"date":"2025-08-18","repo":{"name":"github.com/simplaex/metrics","commit":"f5eb5dd966bfbf4bd3c9a838b9a101236c6e7d2a"},"scorecard":{"version":"v5.2.1-41-g40576783","commit":"40576783fda6698350fcbbeaea760ff827433034"},"score":3,"checks":[{"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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#maintained"}},{"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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#pinned-dependencies"}},{"name":"Code-Review","score":0,"reason":"Found 1/19 approved changesets -- score normalized to 0","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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#dangerous-workflow"}},{"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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#binary-artifacts"}},{"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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#cii-best-practices"}},{"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/40576783fda6698350fcbbeaea760ff827433034/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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: BSD 2-Clause \"Simplified\" License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/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/40576783fda6698350fcbbeaea760ff827433034/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 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 4 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-23T16:32:34.805Z","repository_id":144533490,"created_at":"2025-08-23T16:32:34.806Z","updated_at":"2025-08-23T16:32:34.806Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275194908,"owners_count":25421668,"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-09-15T02:00:09.272Z","response_time":75,"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":[],"created_at":"2024-12-30T05:54:52.673Z","updated_at":"2025-09-15T02:33:15.694Z","avatar_url":"https://github.com/simplaex.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dogstatsd metrics\n\nThis library implements sending\n[statsd metrics](https://github.com/statsd/statsd/blob/master/docs/metric_types.md)\nwith dogstatsd like tags. Currently it supports sending\n`count` and `gauge` values as well as `timings`.\n\n## Maven dependency\n\n`com.simplaex:metrics` is deployed in Maven central as:\n\n```\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.simplaex\u003c/groupId\u003e\n  \u003cartifactId\u003emetrics\u003c/artifactId\u003e\n  \u003cversion\u003e1.4.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## How to use\n\n`com.simplaex.Metrics` requires a bit of work defining\nthe existing metrics that your application emits. This\nis on purpose to make it easier to maintain the emitted\nmetrics as you will have a central definition of all\nyour metrics that an application emits. That allows you\nto, for example, define sample rates for certain metrics\nin one place.\n\n```\npackage com.simplaex.metrics;\n\nimport lombok.Getter;\nimport lombok.RequiredArgsConstructor;\n\npublic class UsageExample {\n\n  @RequiredArgsConstructor\n  public enum AppMetrics implements Metric\u003cAppMetrics\u003e {\n    SOME_METRIC(\"com.simplaex.request\", Kind.COUNTER, 0.1),\n    SOME_OTHER_METRIC(\"com.simplaex.sessions\", Kind.GAUGE);\n\n    AppMetrics(final String name, final Kind kind) {\n      this(name, kind, 1.0);\n    }\n\n    @Getter\n    private final String name;\n\n    @Getter\n    private final Metric.Kind kind;\n\n    @Getter\n    private final double sampleRate;\n\n  }\n\n  public static void main(final String... args) {\n    final MetricsSender\u003cAppMetrics\u003e metricsSender = new StatsdMetricSender\u003c\u003e();\n\n    metricsSender.emit(AppMetrics.SOME_METRIC.withTag(\"path\", \"/api/v1\").withTag(\"method\", \"GET\"));\n  }\n\n}\n```\n\n## Kubernetes support\n\nBy default statsd metrics will be emitted to `localhost:8125`.\nOn kubernetes you may want to emit a statsd metrics collector\nas a daemon set. In that case expose the UDP port 8125 or your\nmetrics collector contains as a host port. `com.simplaex:metrics`\nwill automatically figure out the ip address of the node your\npod is running on and send metrics there.\n\nThat way you do not need to send UDP metrics over the network.\n\n## Usage with `vertx-sugar`\n\n`com.simplaex:vertx-sugar` uses this library. To bind the metrics\nsender in your module add a provider:\n\n```\n  @Provides\n  public MetricsSender\u003cMyApplicationMetrics\u003e provideMetrics() {\n    return new StatsdMetricSender\u003c\u003e();\n  }\n```\n\nYou can now inject:\n\n```\nprivate final MetricsSender\u003cMyApplicationMetrics\u003e metricsSender;\n```\n\n## Example usage in Scala\n\n```\npackage your.sample.project\n\nimport com.simplaex.metrics.Metric\nimport com.simplaex.metrics.Metric.Kind\n\nimport scala.beans.BeanProperty\n\nsealed abstract class ApplicationMetrics(\n  @BeanProperty val name: String,\n  @BeanProperty val kind: Metric.Kind,\n  sampleRate: Double = 1.0\n) extends Metric[ApplicationMetrics]\n\nobject ApplicationMetrics {\n  object JobStarted extends ApplicationMetrics(\"fountain.started\", Kind.COUNTER)\n  object JobFinished extends ApplicationMetrics(\"fountain.finished\", Kind.COUNTER)\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimplaex%2Fmetrics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimplaex%2Fmetrics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimplaex%2Fmetrics/lists"}