{"id":13677783,"url":"https://github.com/Swatto/promtotwilio","last_synced_at":"2025-04-29T12:31:44.550Z","repository":{"id":43053573,"uuid":"54380623","full_name":"Swatto/promtotwilio","owner":"Swatto","description":"Send text messages for Prometheus alerts using Twilio","archived":false,"fork":false,"pushed_at":"2023-03-28T13:12:50.000Z","size":1069,"stargazers_count":33,"open_issues_count":8,"forks_count":21,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-08-02T13:19:24.684Z","etag":null,"topics":["alert","alertmanager","prometheus","prometheus-alert","twilio"],"latest_commit_sha":null,"homepage":"","language":"Go","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/Swatto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2016-03-21T10:41:02.000Z","updated_at":"2024-08-01T15:58:11.000Z","dependencies_parsed_at":"2024-06-18T23:12:05.074Z","dependency_job_id":"4dac228f-ba93-47c4-9780-53838e2a0e18","html_url":"https://github.com/Swatto/promtotwilio","commit_stats":{"total_commits":35,"total_committers":3,"mean_commits":"11.666666666666666","dds":0.05714285714285716,"last_synced_commit":"bb74cb6ed249bfb496143aeefb8a004ebec80189"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Swatto%2Fpromtotwilio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Swatto%2Fpromtotwilio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Swatto%2Fpromtotwilio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Swatto%2Fpromtotwilio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Swatto","download_url":"https://codeload.github.com/Swatto/promtotwilio/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224173112,"owners_count":17268050,"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":["alert","alertmanager","prometheus","prometheus-alert","twilio"],"created_at":"2024-08-02T13:00:46.960Z","updated_at":"2024-11-11T20:30:17.151Z","avatar_url":"https://github.com/Swatto.png","language":"Go","funding_links":[],"categories":["Tools and projects written in Go"],"sub_categories":[],"readme":"# Prometheus alert with text message\n\nThis is a simple and stupid program that will receive webhooks from [Prometheus](https://prometheus.io/) to send them as text message (using [Twilio](https://www.twilio.com/)) with the summary of the alert.\n\nThe [Docker image](https://hub.docker.com/r/swatto/promtotwilio/) size is less than 9MB.\n\n![Docker Pulls](https://img.shields.io/docker/pulls/swatto/promtotwilio.svg?style=flat-square)\n\n## Configuration\n\nIt needs 4 environment variables:\n\n- `SID` - Twilio Account SID\n- `TOKEN` - Twilio Auth Token\n- `RECEIVER` - Phone number of receiver (optional parameter, representing default receiver)\n- `SENDER` - Phone number managed by Twilio (friendly name)\n\nYou can see a basic launch inside the Makefile.\n\n## API\n\n`/`: ping promtotwilio application. Returns 200 OK if application works fine.\n\n`/send?receiver=\u003crcv\u003e`: send Prometheus firing alerts from payload to a rcv if specified, or to default receiver, represented by RECEIVER environment variable. If none is specified, status code 400 BadRequest is returned.\n\n## Test it\n\nTo send test sms to a phone +zxxxyyyyyyy use the following command (please notice `%2B` symbols, representing a url encoded `+` sign)\n\n```bash\n$ curl -H \"Content-Type: application/json\" -X POST -d \\\n'{\"version\":\"2\",\"status\":\"firing\",\"alerts\":[{\"annotations\":{\"summary\":\"Server down\"},\"startsAt\":\"2016-03-19T05:54:01Z\"}]}' \\\nhttp://localhost:9090/send?receiver=%2Bzxxxyyyyyyy\n```\n\n## Configuration example\n\nHere's a sample Docker Compose file to use it with [cAdvisor](https://github.com/google/cadvisor), [Prometheus](http://prometheus.io/), [Alertmanager](https://github.com/prometheus/alertmanager) and [Grafana](https://github.com/grafana/grafana).\n\n```yml\nsms:\n  image: swatto/promtotwilio:latest\n  environment:\n    SID: xxx\n    TOKEN: xxx\n    RECEIVER: xxx\n    SENDER: xxx\n\nalert:\n  image: prom/alertmanager:latest\n  links:\n   - sms\n  volumes:\n   - ./alertmanager.yml:/etc/alertmanager/config.yml\n\ncontainer:\n  image: google/cadvisor:latest\n  volumes:\n   - /:/rootfs:ro\n   - /var/run:/var/run:rw\n   - /sys:/sys:ro\n   - /var/lib/docker/:/var/lib/docker:ro\n\nprometheus:\n  image: prom/prometheus:latest\n  links:\n   - container\n   - alert\n  volumes:\n   - ./prometheus.yml:/etc/prometheus/prometheus.yml\n   - ./alerts.conf:/etc/prometheus/alerts.conf\n  entrypoint: /bin/prometheus -config.file=/etc/prometheus/prometheus.yml -alertmanager.url=http://alert:9093\n\nweb:\n  image: grafana/grafana:latest\n  links:\n   - prometheus\n  ports:\n   - \"3000:3000\"\n  environment:\n    GF_SERVER_ROOT_URL: http://stats.example.com\n    GF_SECURITY_ADMIN_PASSWORD: 123456\n```\n\nHere's the AlertManager config where `sms` will be provided by Docker Compose\n\n```yml\nroute:\n  receiver: 'admin'\n\nreceivers:\n- name: 'admin'\n  webhook_configs:\n  - url: 'http://sms:9090/send'\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSwatto%2Fpromtotwilio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSwatto%2Fpromtotwilio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSwatto%2Fpromtotwilio/lists"}