{"id":22511177,"url":"https://github.com/renderedtext/go-watchman","last_synced_at":"2026-02-12T17:33:40.737Z","repository":{"id":39851357,"uuid":"283711610","full_name":"renderedtext/go-watchman","owner":"renderedtext","description":"go watchman","archived":false,"fork":false,"pushed_at":"2025-02-20T14:45:27.000Z","size":37,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-14T11:42:31.180Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/renderedtext.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":"2020-07-30T08:17:47.000Z","updated_at":"2025-02-20T14:45:32.000Z","dependencies_parsed_at":"2025-03-28T00:41:13.985Z","dependency_job_id":"363f0bd6-768b-428e-b729-553b394d822b","html_url":"https://github.com/renderedtext/go-watchman","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/renderedtext/go-watchman","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renderedtext%2Fgo-watchman","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renderedtext%2Fgo-watchman/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renderedtext%2Fgo-watchman/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renderedtext%2Fgo-watchman/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/renderedtext","download_url":"https://codeload.github.com/renderedtext/go-watchman/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/renderedtext%2Fgo-watchman/sbom","scorecard":{"id":770840,"data":{"date":"2025-08-11","repo":{"name":"github.com/renderedtext/go-watchman","commit":"224f3cd51ea62259f4ef571fbdd0b1391bee08ff"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 1/12 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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"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":"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":"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":"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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"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":"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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/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 20 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":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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T02:15:03.672Z","repository_id":39851357,"created_at":"2025-08-23T02:15:03.672Z","updated_at":"2025-08-23T02:15:03.672Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29374082,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T08:51:36.827Z","status":"ssl_error","status_checked_at":"2026-02-12T08:51:26.849Z","response_time":55,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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-07T02:09:55.503Z","updated_at":"2026-02-12T17:33:40.718Z","avatar_url":"https://github.com/renderedtext.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Watchman\n\nWatchman is an opinionated StatsD client used for publishing metrics.\n\n## Installation\n\nTo install and configure watchman, use the following snippet:\n\n``` golang\npackage main\n\nimport \"github.com/renderedtext/go-watchman\"\n\nfunc main() {\n  statsdHost := \"0.0.0.0\"\n  statdPort := 8125\n\n  // by convention, this is \u003cservice-name\u003e.\u003cenvironment\u003e\n  metricNamespace := \"example-service.prod\"\n\n  err := watchman.Configure(statsdHost, statdPort, metricNamespace)\n  if err != nil {\n    panic(err)\n  }\n}\n```\n\n### Optional filtering\nIf you need to filter your metrics based on some runtime environment variable, \nyou can use the following snippet:\n``` golang\npackage main\nimport \"github.com/renderedtext/go-watchman\"\nfunc main() {\n  statsdHost := \"0.0.0.0\"\n  statdPort := 8125\n  // by convention, this is \u003cservice-name\u003e.\u003cenvironment\u003e\n  metricNamespace := \"example-service.prod\"\n  doFilter := strconv.ParseBool(os.Getenv(\"DO_FILTER\"))\n  err := watchman.ConfigureWithOptions(watchman.Options{\n\t\tHost:                  statsdHost,\n\t\tPort:                  statsdPort,\n    MetricPrefix:          metricNamespace,\n    MetricsChannel:        watchman.InternalOnly,\n\t\tConnectionAttempts:    5,\n\t\tConnectionAttemptWait: 2 * time.Second,\n\t})\n  if err != nil {\n    panic(err)\n  }\n}\n```\nThis flag ```MetricsChannel``` can be set to one of the following `InternalOnly`, `ExternalOnly` or `All`\nIf you want `ExternalOnly` metrics to be passed through you ***must*** \nuse external client. e.g.\n```golang\nwatchman.External().Submit(\"user.count\", 12)\n```\n\n### Metrics Backends\nMetrics backend can be set with `BackendType` option, default is `BackendGraphite` and it will send metrics in the form:\n```\ntagged.{metricPrefix}.{[tags]}.metricName\n```\nthe other available option is `BackendCloudwatch` that tags metrics in `Datadog's` style:\n```\n{metricPrefix}.{name}|{metricType}|#{[tags]}\n```\nwith `BackendCloudwatch` option set you **must** send metrics in key-value pairs, if there is uneven number of elements in tags array library will panic.\n\n## Submitting gauges\n\nTo submit a simple gauge value use `watchman.Submit`. For example, if you want\nto submit that you have 12 users in the database, you would use:\n\n``` golang\nwatchman.Submit(\"user.count\", 12)\n```\n\nNow, let's suppose that you want to measure the number of users per group, where\neach group has a name. You would use:\n\n``` golang\nfor _, group := range groups {\n\twatchman.SubmitWithTags(\"user.count\", []string{group.Name}, group.UserCount())\n}\n```\n\nNotice that for the above example we used `watchman.SubmitWithTags`. Tags are\nthe ideal way to submit variable identifiers like group name.\n\nHere is rule of thumb:\n\n``` golang\n//\n// BAD, don't do this.\n//\n// It will create a dedicated metric for each group and\n// overload the backend system.\n//\nwatchman.Submit(fmt.Sprintf(\"users.%s.count\", group.Name), group.UserCount())\n\n//\n// GOOD, do this.\n//\n// Tags are a cheap and won't cause problems in the database. Use tags for\n// variable data.\n//\nwatchman.SubmitWithTags(\"user.count\", []string{group.Name}, group.UserCount())\n```\n\n## Submitting benchmarks\n\nTo measure the execution speed of functions, use `watchman.Benchmark` or\n`watchman.BenchmarkWithTags`.\n\nFor example, if you have a `RegisterUser` function:\n\n``` golang\nfunc RegisterUser(name, email string) (*models.User, error) {\n  if err := Validate(name, email) {\n    return nil, err\n  }\n\n  return models.CreateUser(name, email)\n}\n```\n\nTo measure how it performs, use:\n\n``` golang\nfunc RegisterUser(name, email string) (*models.User, error) {\n  defer watchman.Benchmark(Time.Now(), \"http.register.user.duration\")\n\n  if err := Validate(name, email) {\n    return nil, err\n  }\n\n  return models.CreateUser(name, email)\n}\n```\n\n## Counting events\n\nTo count events use one of:\n\n- `watchman.Increment`\n- `watchman.IncrementBy`\n- `watchman.IncrementWithTags`\n\nExamples:\n\n``` golang\nwatchman.Increment(\"profile-page.visits\")\nwatchman.IncrementBy(\"users.added\", len(users))\nwatchman.IncrementByWithTags(\"users.added.to.group\", []string{group.Name}, len(group.UserCount()))\n```\n\n## License\n\nThis software is licensed under [the Apache 2.0 license](LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frenderedtext%2Fgo-watchman","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frenderedtext%2Fgo-watchman","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frenderedtext%2Fgo-watchman/lists"}