https://github.com/macbre/http-shadow
Compares HTTP responses from two different backends
https://github.com/macbre/http-shadow
sre sus
Last synced: 3 months ago
JSON representation
Compares HTTP responses from two different backends
- Host: GitHub
- URL: https://github.com/macbre/http-shadow
- Owner: macbre
- License: mit
- Created: 2018-09-06T09:31:04.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-10-02T08:42:03.000Z (about 5 years ago)
- Last Synced: 2025-02-22T19:12:52.602Z (7 months ago)
- Topics: sre, sus
- Language: Python
- Size: 43 KB
- Stars: 0
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# http-shadow
Compares HTTP responses from two different backends### How to run
1. Set up virtualenv with python 3
2. Install dependencies by running `python setup.py develop`
3. Run the following (preferrably in `screen`):```
get_urls | check_urls
```This will pipe URLs found in Apache access log to the process that will perform two requests: to Apache and to Kubernetes. Response code and headers will be compared and results logged via syslog with `http-shadow` ident.
4. To compare production vs k8s-powered sandbox use:
```
get_urls | check_urls
```### Log entry example
```json
{
"appname": "http-shadow",
"is_ok": true,
"url": "http://muppet.fandom.com/wiki/Elmo",
"apache": {
"response": {
"status_code": 200,
"location": null,
"cache_control": "s-maxage=86400, must-revalidate, max-age=0",
"content_type": "text/html; charset=utf-8"
},
"info": {
"x_served_by": "ap-s204",
"x_response_time": 0.083
}
},
"kube": {
"response": {
"status_code": 200,
"location": null,
"cache_control": "s-maxage=86400, must-revalidate, max-age=0",
"content_type": "text/html; charset=utf-8"
},
"info": {
"x_served_by": "mediawiki-sandbox-s6-99597bbd4-f2h7q",
"x_response_time": 0.124
}
}
}
```### Tests
Run `py.test`.