{"id":15567574,"url":"https://github.com/wgrape/apinotice","last_synced_at":"2025-04-24T00:03:54.591Z","repository":{"id":66350747,"uuid":"510729724","full_name":"WGrape/APINotice","owner":"WGrape","description":"A service-level alarm platform based on kibana watcher / 一个基于Kibana Watcher的服务分级报警平台","archived":false,"fork":false,"pushed_at":"2023-05-29T14:00:42.000Z","size":4,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-24T00:03:48.325Z","etag":null,"topics":["elasticsearch","kibana","php"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WGrape.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":"2022-07-05T12:36:36.000Z","updated_at":"2024-03-07T10:02:22.000Z","dependencies_parsed_at":"2024-10-02T17:11:56.588Z","dependency_job_id":null,"html_url":"https://github.com/WGrape/APINotice","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/WGrape%2FAPINotice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WGrape%2FAPINotice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WGrape%2FAPINotice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WGrape%2FAPINotice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WGrape","download_url":"https://codeload.github.com/WGrape/APINotice/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250535098,"owners_count":21446508,"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":["elasticsearch","kibana","php"],"created_at":"2024-10-02T17:11:51.681Z","updated_at":"2025-04-24T00:03:54.569Z","avatar_url":"https://github.com/WGrape.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# APINotice\nA service-level alarm platform based on kibana watcher / 一个基于Kibana Watcher的服务分级报警平台\n\n## Intro\n\nAbout more news, please click here.\n- [设计与实现基于Kibana Watcher的服务分级报警平台](https://github.com/WGrape/Blog/issues/220)\n\n## Configure\n\u003cdetails\u003e\n\n\u003csummary\u003econfigure template\u003c/summary\u003e\n\n```json\n{\n  \"trigger\": {\n    \"schedule\": {\n      \"interval\": \"1m\"\n    }\n  },\n  \"input\": {\n    \"search\": {\n      \"request\": {\n        \"search_type\": \"query_then_fetch\",\n        \"indices\": [\n          \"\u003clog-yourbusiness-{now/d}\u003e\"\n        ],\n        \"rest_total_hits_as_int\": true,\n        \"body\": {\n          \"query\": {\n            \"bool\": {\n              \"must\": [],\n              \"filter\": [\n                {\n                  \"bool\": {\n                    \"should\": [\n                      {\n                        \"match\": {\n                          \"level\": \"FATAL\"\n                        }\n                      }\n                    ],\n                    \"minimum_should_match\": 1\n                  }\n                },\n                {\n                  \"match_phrase\": {\n                    \"level\": \"FATAL\"\n                  }\n                },\n                {\n                  \"range\": {\n                    \"@timestamp\": {\n                      \"gte\": \"now-1m\"\n                    }\n                  }\n                }\n              ],\n              \"should\": [],\n              \"must_not\": []\n            }\n          }\n        }\n      }\n    }\n  },\n  \"condition\": {\n    \"compare\": {\n      \"ctx.payload.hits.total\": {\n        \"gte\": 1\n      }\n    }\n  },\n  \"actions\": {\n    \"my_webhook\": {\n      \"webhook\": {\n        \"scheme\": \"http\",\n        \"host\": \"webhook.yousite.com\",\n        \"port\": 80,\n        \"method\": \"post\",\n        \"path\": \"/alerts/trigger/\",\n        \"headers\": {\n          \"Content-Type\": \"application/json\"\n        },\n        \"body\": \"{\\\"status\\\":\\\"alert\\\",\\\"labels\\\":{\\\"alertname\\\":\\\"business-watcher-level\\\"},\\\"annotations\\\":{\\\"summary\\\":\\\"【业务服务S级报警】{{ctx.payload.hits.hits.0._source.service_id}} ({{ctx.payload.hits.hits.0._source.uri}}) 一分钟 {{ctx.payload.hits.total}} 条\\\",\\\"description\\\":\\\"[{{ctx.payload.hits.hits.0._source.service_id}}] 一分钟内产生 {{ctx.payload.hits.total}}  条错误日志 , human_time: {{ctx.payload.hits.hits.0._source.human_time}} , traceid: {{ctx.payload.hits.hits.0._source.traceid}} , service_id: {{ctx.payload.hits.hits.0._source.service_id}} , message: {{ctx.payload.hits.hits.0._source.message}}\\\",\\\"detail_url\\\":\\\"\\\"}}\"\n      }\n    }\n  }\n}\n```\n\n\u003c/details\u003e\n\n## Example\n\n\u003cimg width=\"1726\" alt=\"截屏2023-05-29 21 23 53\" src=\"https://github.com/WGrape/runview/assets/35942268/673ad66f-a74e-44c3-98a2-dd8d00260cb7\"\u003e\n\n\u003cimg width=\"1717\" alt=\"截屏2023-05-29 21 24 46\" src=\"https://github.com/WGrape/runview/assets/35942268/034b26df-c29e-44a2-bc60-f1ab64bcc277\"\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwgrape%2Fapinotice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwgrape%2Fapinotice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwgrape%2Fapinotice/lists"}