{"id":32214716,"url":"https://github.com/domm/plack-app-servicestatus","last_synced_at":"2025-10-22T07:11:33.605Z","repository":{"id":48356468,"uuid":"61040317","full_name":"domm/Plack-App-ServiceStatus","owner":"domm","description":"Check and report status of various services needed by your plack app","archived":false,"fork":false,"pushed_at":"2024-01-25T10:00:31.000Z","size":61,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-01-25T11:26:43.504Z","etag":null,"topics":["hacktoberfest","plack","psgi"],"latest_commit_sha":null,"homepage":"","language":"Perl","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/domm.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","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}},"created_at":"2016-06-13T13:52:49.000Z","updated_at":"2024-01-25T11:26:50.498Z","dependencies_parsed_at":"2023-11-27T14:44:17.406Z","dependency_job_id":null,"html_url":"https://github.com/domm/Plack-App-ServiceStatus","commit_stats":{"total_commits":38,"total_committers":3,"mean_commits":"12.666666666666666","dds":"0.13157894736842102","last_synced_commit":"7ef9f52eb0764aca4e25694e3fca139f601b7b2a"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/domm/Plack-App-ServiceStatus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/domm%2FPlack-App-ServiceStatus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/domm%2FPlack-App-ServiceStatus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/domm%2FPlack-App-ServiceStatus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/domm%2FPlack-App-ServiceStatus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/domm","download_url":"https://codeload.github.com/domm/Plack-App-ServiceStatus/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/domm%2FPlack-App-ServiceStatus/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280396355,"owners_count":26323688,"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-10-22T02:00:06.515Z","response_time":63,"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":["hacktoberfest","plack","psgi"],"created_at":"2025-10-22T07:09:31.610Z","updated_at":"2025-10-22T07:11:33.598Z","avatar_url":"https://github.com/domm.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NAME\n\nPlack::App::ServiceStatus - Check and report status of various services needed by your app\n\n# VERSION\n\nversion 0.913\n\n# SYNOPSIS\n\n    # using Plack::Builder with Plack::App::URLMap\n    use Plack::Builder;\n    use Plack::App::ServiceStatus;\n\n    my $status_app = Plack::App::ServiceStatus-\u003enew(\n        app           =\u003e 'your app',\n        version       =\u003e '1.42',\n        DBIC          =\u003e [ $schema, 'select 1' ],\n        Elasticsearch =\u003e $es, # instance of Search::Elasticsearch\n    )-\u003eto_app;\n\n    builder {\n      mount \"/_status\" =\u003e $status_app;\n      mount \"/\" =\u003e $your_app;\n    };\n\n\n    # using OX\n    router as {\n        mount '/_status' =\u003e 'Plack::App::ServiceStatus' =\u003e (\n            app                     =\u003e literal(__PACKAGE__),\n            Redis                   =\u003e 'redis',\n            '+MyApp::ServiceStatus' =\u003e {\n                  foo =\u003e literal(\"foo\")\n            },\n            buildinfo =\u003e literal('buildinfo.json'),\n        );\n        route '/some/endpoint' =\u003e 'some_controller.some_action';\n        # ...\n    };\n\n\n    # checking the status\n    curl http://localhost:3000/_status | json_pp\n    {\n       \"app\" : \"Your app\",\n       \"version\": \"1.42\",\n       \"started_at\" : 1465823638,\n       \"uptime\" : 42,\n       \"checks\" : [\n          {\n             \"status\" : \"ok\",\n             \"name\" : \"Your app\"\n          },\n          {\n             \"name\" : \"Elasticsearch\",\n             \"status\" : \"ok\"\n          },\n          {\n             \"name\" : \"DBIC\",\n             \"status\" : \"ok\"\n          }\n       ]\n    }\n\n# DESCRIPTION\n\n`Plack::App::ServiceStatus` implements a small\n[Plack](https://metacpan.org/pod/Plack) application that you can use\nto get some status info about your application and the services needed by\nit.\n\nYou can then use some monitoring software to periodically check if\nyour app is running and has access to all needed services.\n\n## Options to new\n\n- name\n\n    The name of your app.\n\n- version\n\n    The version of your app.\n\n    item \\* DBI, DBIxConnector, DBIC, Redis, Elasticsearch, NetStomp\n\n    Enable and configure a check, see [Checks](https://metacpan.org/pod/Checks) below\n\n- show\\_hostname\n\n    If set to a true value, show the hostname.\n\n- buildinfo\n\n    Path to a `buildinfo.json` JSON file containing information on\n    when/how the app was built. See\n    [\"plack\\_app\\_service\\_status\\_generate\\_buildinfo.pl\" in bin](https://metacpan.org/pod/bin#plack_app_service_status_generate_buildinfo.pl) for a script\n    that will generate a `buildinfo.json` containing the build date, git\n    commit and git branch.\n\n## Checks\n\nThe following checks are currently available:\n\n- [Plack::App::ServiceStatus::DBI](https://metacpan.org/pod/Plack%3A%3AApp%3A%3AServiceStatus%3A%3ADBI) - (raw DBI `$dbh`)\n- [Plack::App::ServiceStatus::DBIxConnector](https://metacpan.org/pod/Plack%3A%3AApp%3A%3AServiceStatus%3A%3ADBIxConnector) - when using `DBIx::Connector` to connect to a DB\n- [Plack::App::ServiceStatus::DBIC](https://metacpan.org/pod/Plack%3A%3AApp%3A%3AServiceStatus%3A%3ADBIC) - when you're using `DBIx::Class`\n- [Plack::App::ServiceStatus::Redis](https://metacpan.org/pod/Plack%3A%3AApp%3A%3AServiceStatus%3A%3ARedis)\n- [Plack::App::ServiceStatus::Elasticsearch](https://metacpan.org/pod/Plack%3A%3AApp%3A%3AServiceStatus%3A%3AElasticsearch)\n- [Plack::App::ServiceStatus::NetStomp](https://metacpan.org/pod/Plack%3A%3AApp%3A%3AServiceStatus%3A%3ANetStomp)\n\nEach check consists of a `name` and a `status`. The status can be\n`ok` or `nok`. A check might also contain a `message`, which should\nbe some description of the error or problem if the status is `nok`.\n\nEach check has to implement a method named `check` which will be\ncalled with name of the class and the arguments you specified when\nsetting up `Plack::App::ServiceStatus`. `check` has to return either\nthe string `ok`, or the string `nok` and a string containing an\nexplanation.\n\nYou can add your own checks by specifying a name starting with a `+`\nsign, for example `+My::App::SomeStatusCheck`. Or send me a pull\nrequest to include your check in this distribution, or just release it\nyourself!\n\n## Weirdness\n\nThe slightly strange way `Plack::App::ServiceStatus` is initiated is caused\nby the way [OX](https://metacpan.org/pod/OX) works.\n\n`Plack::App::ServiceStatus` is **not** implemented as a middleware on\npurpose. While middlewares are great for a lot of use cases, I think\nthat here an embedded app is the better fit.\n\n# TODO\n\n- make sure the app is only initiated once when running in OX\n\n# THANKS\n\nThanks to\n\n- [validad.com](https://www.validad.com/) for funding the\ndevelopment of this code.\n- [Manfred Stock](https://github.com/mstock) for adding\nNet::Stomp and a Icinga/Nagios check script.\n- [VÖV / Knowledgebase Erwachsenenbildung](https://adulteducation.at/) for the buildinfo feature.\n\n# AUTHOR\n\nThomas Klausner \u003cdomm@plix.at\u003e\n\n# COPYRIGHT AND LICENSE\n\nThis software is copyright (c) 2016 - 2022 by Thomas Klausner.\n\nThis is free software; you can redistribute it and/or modify it under\nthe same terms as the Perl 5 programming language system itself.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdomm%2Fplack-app-servicestatus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdomm%2Fplack-app-servicestatus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdomm%2Fplack-app-servicestatus/lists"}