{"id":21843948,"url":"https://github.com/fsaintjacques/survivalkit","last_synced_at":"2025-03-21T16:18:42.958Z","repository":{"id":138958132,"uuid":"89757813","full_name":"fsaintjacques/survivalkit","owner":"fsaintjacques","description":"A survival kit is a package of basic tools and supplies prepared in advance as an aid to survival in an emergency.","archived":false,"fork":false,"pushed_at":"2017-06-08T11:25:14.000Z","size":51,"stargazers_count":0,"open_issues_count":7,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-26T11:42:04.350Z","etag":null,"topics":["c","health-check","healthcheck","logger","monitoring","sre"],"latest_commit_sha":null,"homepage":null,"language":"C","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/fsaintjacques.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-04-29T02:04:36.000Z","updated_at":"2018-06-04T15:33:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"ad41d481-646b-4cb7-8a15-fe7d787483e8","html_url":"https://github.com/fsaintjacques/survivalkit","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/fsaintjacques%2Fsurvivalkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fsaintjacques%2Fsurvivalkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fsaintjacques%2Fsurvivalkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fsaintjacques%2Fsurvivalkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fsaintjacques","download_url":"https://codeload.github.com/fsaintjacques/survivalkit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244825655,"owners_count":20516592,"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":["c","health-check","healthcheck","logger","monitoring","sre"],"created_at":"2024-11-27T22:17:46.275Z","updated_at":"2025-03-21T16:18:42.944Z","avatar_url":"https://github.com/fsaintjacques.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Surival Kit\n\nA survival kit is a package of basic tools and supplies prepared in advance as\nan aid to survival in an emergency.\n\nThis library aims to offer facilities to ease the implementation of production\nready services.\n\n## Goals\n\n* Linux first, readability of code is much more important than portability\n* Thread safe, lightweight\n* Container friendly, does not depends on local external processes\n* Integrate easily with multiple backend\n\n## Facilities\n\n\n### Lifecycle\n\nLifecycle is a thread safe state machine representing the operational state\nof a component. A lifecycle might serve many purposes:\n\n* Improve auditing via event logs\n* Automatically toggles healthcheck in STARTING and STOPPING transitions\n* Centralize the exit condition of a main loop\n\nThe possibles transitions are given by the following state machine:\n\n```\n  NEW → STARTING → RUNNING → STOPPING → TERMINATED\n   └───────┴──────────┴─────────┴─────→ FAILED\n```\n\n### Health checks\n\nRegisters callbacks that exports health status of components. This allows the\napplication to easily expose a health endpoint.\n\n### Logs\n\nLog are stored into a ring buffer. Each logger instance has his own\nbuffer \u0026 log level. Loggers are layered in a hierarchy and one can dynamically\nmanipulate loggers' level with a regex, e.g.\n\n`sk_logger_set_level_match(\"myapp.db.*\", SK_LOG_WARNING);`\n\n### Metrics\n\nRegisters metrics that represent statistics of components. Supported counter\ntypes:\n\n* counter\n* gauge\n* histogram\n\n### Managed components\n\nAdd support for managing components that requires to be properly\nstarted/stopped, e.g. disk flush, database connections.\n\n### Watchdog\n\nAdd support for automatic process restart, e.g. parent process monitoring.\n\n### Exporter\n\nExport the various utilities mentioned earlier to external sources, e.g.\n\n  * health check =\u003e nagios\n  * events =\u003e syslog or udp syslog\n  * metrics =\u003e prometheus or graphite\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffsaintjacques%2Fsurvivalkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffsaintjacques%2Fsurvivalkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffsaintjacques%2Fsurvivalkit/lists"}