{"id":18296007,"url":"https://github.com/petergrace/anchorage","last_synced_at":"2025-04-09T08:42:08.705Z","repository":{"id":145478840,"uuid":"84473177","full_name":"PeterGrace/anchorage","owner":"PeterGrace","description":"Light wrapper to enable nimble checks to be input to bosun without needing scollector","archived":false,"fork":false,"pushed_at":"2018-03-21T14:49:21.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-15T02:44:36.553Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/PeterGrace.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":"2017-03-09T18:03:40.000Z","updated_at":"2018-03-21T14:49:22.000Z","dependencies_parsed_at":"2023-05-24T09:30:35.927Z","dependency_job_id":null,"html_url":"https://github.com/PeterGrace/anchorage","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterGrace%2Fanchorage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterGrace%2Fanchorage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterGrace%2Fanchorage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PeterGrace%2Fanchorage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PeterGrace","download_url":"https://codeload.github.com/PeterGrace/anchorage/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248008388,"owners_count":21032553,"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-05T14:39:06.186Z","updated_at":"2025-04-09T08:42:08.690Z","avatar_url":"https://github.com/PeterGrace.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"anchorage\n===============\nAnchorage is a small python framework for emitting metadata-defined metrics into Bosun.\n\n\n- Create a new python file with the below contents.  \n- Define your metrics in check_hash\n- write your actual check logic in the func defined in check_hash, in the below example testcheck()\n- your check function must return a hash with value defined by 'value' key, and a sub-hash of tags in key 'tags'.\n\nExample instantiation: `anchorage --debug --test --token \u003cbosun-auth-token\u003e \u003cmodulename-not-filename\u003e \u003curl-of-bosun-server\u003e`\n\n- --test does not send data to the server.\n- --debug enables debug logging inside of anchorage\n\n\nTo execute the example, use `anchorage --debug --test examples/example http://invalidurl`\n\nExample module from examples directory:\n```\nfrom anchorage.check import Check\n\n\ndef testcheck():\n    return {\n        'value': '0',\n        'tags':\n            {'host': 'host'}\n    }\n\ncheck_hash = {\n    'pete.widgets': {\n        'rate': 'gauge',\n        'unit': 'Widgets per Fortnight',\n        'desc': 'the number of widgets created per fortnight of production',\n        'func': testcheck\n    }\n}\n\nc = Check(check_hash)\n\n\ndef initialize(url, token):\n    c.set_url(url, token)\n\n\ndef execute():\n    return c.run_checks()\n\n\ndef run_tests():\n    return c.run_tests()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpetergrace%2Fanchorage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpetergrace%2Fanchorage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpetergrace%2Fanchorage/lists"}