Ranch
=====
Standardized tooling, monitoring, and retry logic for use with Celery
## Installation
Ranch is a Django application. To use Ranch with Celery, add the following to your settings file:
```python
INSTALLED_APPS = [
...
'mbq.ranch'
]
RANCH = {
'env': ENV_NAME, # e.g. production, development
'service': MY_SERVICE_NAME, # e.g. os-core
}
```
## Features
### Metrics
Any application with Ranch installed will have Celery metrics available in [the Celery/Ranch DataDog Dashboard](https://app.datadoghq.com/dash/930140/celery--ranch).
### Monitors
*TODO: Include link to Invoice's monitors once they're built*
You may set up monitors for your application using the metrics provided by Ranch. To get started, you might want to copy Invoicing's monitors.
### Dead Letter Queue
Celery jobs that fail will be stored in the application's database for inspection and reprocessing. Ranch provides an Admin interface for this.
See [OS Core's Ranch Admin](https://api.managedbyq.com/admin/ranch/loggedtask/) for an example.
### Correlation IDs
Ranch can flow correlation IDs through your Celery jobs. Ranch will *not* change any of your logging configuration, so you'll still need to do that as part of your correlation ID implementation.
To use the correlation ID functionality, add the following settings:
```python
RANCH = {
...,
'correlation': {
'getter': getter_fn, # callable with no args that returns the current correlation ID
'setter': setter_fn, # callable with one arg which should be set as the current correlation ID
},
}
```
### Supplemental Error Tagging
Ranch provides a hook to add additional tagging information to error item metrics. This is used in OS Core to tag each error as belonging to a specific team.
To use this feature, add the following settings:
```python
RANCH = {
...,
# tags_fn takes a single arg (the Ranch Task object that failed)
# and should return a list of strings in the format "tag_name:tag_value"
# See OS Core's usage for an example
'extra_error_queue_tags_fn': tags_fn,
}
```
没有合适的资源?快使用搜索试试~ 我知道了~
PyPI 官网下载 | mbq.ranch-2.0.1.tar.gz
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
1 下载量 181 浏览量
2022-01-13
03:25:40
上传
评论
收藏 13KB GZ 举报
温馨提示
共44个文件
py:35个
txt:4个
pkg-info:2个
资源来自pypi官网。 资源全名:mbq.ranch-2.0.1.tar.gz
资源详情
资源评论
资源推荐
收起资源包目录
mbq.ranch-2.0.1.tar.gz (44个子文件)
mbq.ranch-2.0.1
PKG-INFO 3KB
mbq
__init__.py 149B
ranch
constants.py 176B
models.py 733B
apps.py 694B
stats
rabbitmq.py 2KB
__init__.py 0B
controllers.py 893B
__init__.py 243B
signal_handlers
config_handlers.py 1KB
rollbar_handlers.py 541B
metrics_handlers.py 5KB
correlation_handlers.py 997B
__init__.py 121B
persistence_handlers.py 1KB
migrations
0002_loggedtask_queue.py 395B
__init__.py 0B
0001_initial.py 992B
admin.py 2KB
lib
error_handling.py 433B
__init__.py 0B
__version__.py 237B
killswitch.py 868B
exceptions.py 40B
mbq.ranch.egg-info
PKG-INFO 3KB
requires.txt 75B
SOURCES.txt 1KB
top_level.txt 10B
dependency_links.txt 1B
zip-safe 1B
tests
launch_darkly.py 469B
tests
test_controllers.py 3KB
__init__.py 0B
settings.py 300B
test_killswitch.py 1KB
wsgi.py 167B
__init__.py 0B
settings.py 3KB
tasks.py 221B
urls.py 273B
celery.py 677B
setup.cfg 526B
setup.py 1KB
README.md 2KB
共 44 条
- 1
挣扎的蓝藻
- 粉丝: 13w+
- 资源: 15万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0