{"id":22671493,"url":"https://github.com/cloudforet-io/plugin-prometheus-mon-webhook","last_synced_at":"2025-08-23T01:41:55.088Z","repository":{"id":109063094,"uuid":"532701186","full_name":"cloudforet-io/plugin-prometheus-mon-webhook","owner":"cloudforet-io","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-10T04:57:49.000Z","size":33778,"stargazers_count":4,"open_issues_count":1,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-10T05:39:11.070Z","etag":null,"topics":["monitoring","plugin","webhook"],"latest_commit_sha":null,"homepage":"","language":"Python","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/cloudforet-io.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-09-05T01:15:15.000Z","updated_at":"2025-04-10T04:57:42.000Z","dependencies_parsed_at":"2025-03-17T21:47:02.267Z","dependency_job_id":null,"html_url":"https://github.com/cloudforet-io/plugin-prometheus-mon-webhook","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudforet-io%2Fplugin-prometheus-mon-webhook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudforet-io%2Fplugin-prometheus-mon-webhook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudforet-io%2Fplugin-prometheus-mon-webhook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudforet-io%2Fplugin-prometheus-mon-webhook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudforet-io","download_url":"https://codeload.github.com/cloudforet-io/plugin-prometheus-mon-webhook/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248565385,"owners_count":21125481,"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":["monitoring","plugin","webhook"],"created_at":"2024-12-09T16:15:15.977Z","updated_at":"2025-04-12T12:23:18.965Z","avatar_url":"https://github.com/cloudforet-io.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# plugin-prometheus-monitoring-webhook\nwebhook for prometheus\n\n# Data Model\n\n## Prometheus Raw Data\n\nPrometheus Notification Template Data Structure Reference : https://prometheus.io/docs/alerting/latest/notifications/#data\n~~~\n{\n    \"status\": \"firing\",\n    \"version\": \"4\",\n    \"receiver\": \"prometheus-spaceone-prometheus-webhook-alert-manager-config-spaceone-prometheus-webhook\",\n    \"alerts\": [\n        {\n            \"generatorURL\": \"http://prometheus-1-kube-promethe-prometheus.default:xxx\",\n            \"status\": \"firing\",\n            \"annotations\": {\n                \"description\": \"Pod prometheus/prometheus-prometheus-node-exporter-xp6jv has been in a non-ready state for longer than 15 minutes.\",\n                \"summary\": \"Pod has been in a non-ready state for more than 15 minutes.\",\n                \"runbook_url\": \"https://github.com/kubernetes-monitoring/kubernetes-mixin/tree/master/runbook.\"\n            },\n            \"fingerprint\": \"469fd6fbb9dbabaa\",\n            \"labels\": {\n                \"prometheus\": \"default/prometheus-1-kube-promethe-prometheus\",\n                \"severity\": \"warning\",\n                \"namespace\": \"prometheus\",\n                \"pod\": \"prometheus-prometheus-node-exporter-xp6jv\",\n                \"alertname\": \"KubePodNotReady\"\n            },\n            \"startsAt\": \"2021-10-12T04:13:01.794Z\",\n            \"endsAt\": \"0001-01-01T00:00:00Z\"\n        }\n    ],\n    \"groupLabels\": {},\n    \"truncatedAlerts\": 0.0,\n    \"groupKey\": \"{}/{namespace=\\\"prometheus\\\"}:{}\",\n    \"commonLabels\": {\n        \"pod\": \"prometheus-prometheus-node-exporter-xp6jv\",\n        \"namespace\": \"prometheus\",\n        \"prometheus\": \"default/prometheus-1-kube-promethe-prometheus\",\n        \"severity\": \"warning\",\n        \"alertname\": \"KubePodNotReady\"\n    },\n    \"externalURL\": \"http://prometheus-1-kube-promethe-alertmanager.default:9093\",\n    \"commonAnnotations\": {\n        \"description\": \"Pod prometheus/prometheus-prometheus-node-exporter-xp6jv has been in a non-ready state for longer than 15 minutes.\",\n        \"runbook_url\": \"https://github.com/kubernetes-monitoring/kubernetes-mixin/tree/master/runbook#md#alert-name-kubepodnotready\",\n        \"summary\": \"Pod has been in a non-ready state for more than 15 minutes.\"\n    }\n}\n~~~\n\n## Event key criteria\n```fingerprint``` \n\n## Severity matching information\n|Prometheus  ```severity```| SpaceONE event  ```severity```|\n|---|---|\n|critical|CRITICAL|\n|error|ERROR|\n|warning|WARNING|\n|info|INFO|\n\n## SpaceONE Event Model\n\n| Field\t\t| Type | Description\t| Example\t|\n| ---      | ---     | ---           | ---           |\n| event_id | str  | auto generation | event-1234556  |\n| event_key | str | fingerprint | 469fd6fbb9dbabaa |\n| event_type | str | RECOVERY , ALERT based on `raw_data.state` | RECOVERY\t|\n| title | str\t| `raw_data.annotations.summary`\t| Pod has been in a non-ready state for more than 15 minutes.\t|\n| description | str | `raw_data.annotations.description`\t| Pod prometheus/prometheus-xxx has been in a non-ready state for longer than 15 minutes.|\n| severity | str  | alert level based `raw_data.alert.labels.severity (critical : CRITICAL / error : ERROR / warning: WARNING / info: INFO ` | ERROR |\n| resource | dict | resource which triggered this alert\t| ` {'pod':'prometheus-prometheus-node-exporter-xp6jv','alertname': 'KubePodNotReady'}` |\n| raw_data | dict | Prometheus webhook received  data structure | - |\n| additional_info | dict | `raw_data.alert.annotations` / `raw_data.alert.generatorURL`, `raw_data.alert.endsAt` | `{\"org_id\": \"1.0\", \"rule_url\" \"https://....\" }` |\n| occured_at | datetime | prometheus alert triggered time , `alert.startsAt` | `2021-10-12T04:13:01.794Z`|\n| alert_id | str | mapped alert_id\t| alert-3243434343 |\n| webhook_id | str  | webhook_id\t| webhook-34324234234234 |\n| project_id | str\t| project_id\t| project-12312323232    |\n| domain_id | str\t| domain_id\t| domain-12121212121\t|\n| created_at | datetime | webhook alert created time | \"2021-08-23T06:47:32.753Z\"\t|\n\n\n## cURL Requests examples\nThis topic provides examples of calls to the SpaceONE Prometheus monitoring webhook using cURL.\n\nHere's a cURL command that works for getting the response from webhook, you can test the following on your local machine.\n```\ncurl -X POST https://your_spaceone_monitoring_webhook_url -d '{}'\n \n```\n\nFollowings are examples which works for testing your own webhook.\n\n```\ncurl -X POST https://{your_spaceone_monitoring_prometheus_webhook_url} -d '{\n  {\n        'version': '4',\n        'alerts': [\n            {\n                'labels': {\n                    'prometheus': 'default/prometheus-1-kube-promethe-prometheus',\n                    'severity': 'warning',\n                    'alertname': 'KubePodNotReady',\n                    'namespace': 'prometheus',\n                    'pod': 'prometheus-prometheus-node-exporter-xp6jv'\n                },\n                'endsAt': '0001-01-01T00:00:00Z',\n                'annotations': {\n                    'description': 'Pod prometheus/prometheus-prometheus-node-exporter-xp6jv has been in a non-ready state for longer than 15 minutes.',\n                    'runbook_url': 'https://github.com/kubernetes-monitoring/kubernetes-mixin/tree/master/runbook.md#alert-name-kubepodnotready',\n                    'summary': 'Pod has been in a non-ready state for more than 15 minutes.'\n                },\n                'status': 'firing',\n                'generatorURL': 'http://prometheus-1-kube-promethe-prometheus.default:9090/graph?g0.expr=sum+by%28namespace%2C+pod%29+%28max+by%28namespace%2C+pod%29+%28kube_pod_status_phase%7Bjob%3D%22kube-state-metrics%22%2Cnamespace%3D~%22.%2A%22%2Cphase%3D~%22Pending%7CUnknown%22%7D%29+%2A+on%28namespace%2C+pod%29+group_left%28owner_kind%29+topk+by%28namespace%2C+pod%29+%281%2C+max+by%28namespace%2C+pod%2C+owner_kind%29+%28kube_pod_owner%7Bowner_kind%21%3D%22Job%22%7D%29%29%29+%3E+0\u0026g0.tab=1',\n                'startsAt': '2021-10-12T04:13:01.794Z',\n                'fingerprint': '469fd6fbb9dbabaa'\n            }\n        ],\n        'truncatedAlerts': 0.0,\n        'receiver': 'prometheus-spaceone-prometheus-webhook-alert-manager-config-spaceone-prometheus-webhook',\n        'groupKey': '{}/{namespace=\"prometheus\"}:{}',\n        'status': 'firing',\n        'commonAnnotations': {\n            'description': 'Pod prometheus/prometheus-prometheus-node-exporter-xp6jv has been in a non-ready state for longer than 15 minutes.',\n            'runbook_url': 'https://github.com/kubernetes-monitoring/kubernetes-mixin/tree/master/runbook.md#alert-name-kubepodnotready',\n            'summary': 'Pod has been in a non-ready state for more than 15 minutes.'\n        },\n        'groupLabels': {},\n        'commonLabels': {\n            'severity': 'warning',\n            'alertname': 'KubePodNotReady',\n            'pod': 'prometheus-prometheus-node-exporter-xp6jv',\n            'prometheus': 'default/prometheus-1-kube-promethe-prometheus',\n            'namespace': 'prometheus'\n        },\n        'externalURL': 'http://prometheus-1-kube-promethe-alertmanager.default:9093'\n    }\n}'\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudforet-io%2Fplugin-prometheus-mon-webhook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloudforet-io%2Fplugin-prometheus-mon-webhook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudforet-io%2Fplugin-prometheus-mon-webhook/lists"}