|
4 | 4 |
|
5 | 5 | ### Various fixes & improvements
|
6 | 6 |
|
7 |
| -- Celery Beat auto monitoring (#1967) by @antonpirker |
8 |
| -- Do not trim span descriptions. (#1983) by @antonpirker |
9 |
| -- Add integerations for socket and grpc (#1911) by @hossein-raeisi |
| 7 | +- **New:** [Celery Beat](https://docs.celeryq.dev/en/stable/userguide/periodic-tasks.html) auto monitoring (#1967) by @antonpirker |
| 8 | + |
| 9 | + The CeleryIntegration can now also monitor your Celery Beat scheduled tasks automatically using the new [Crons](https://blog.sentry.io/2023/01/04/cron-job-monitoring-beta-because-scheduled-jobs-fail-too/) feature of Sentry. |
| 10 | + |
| 11 | + To learn more see our [Celery Beat Auto Discovery](https://docs.sentry.io/platforms/python/guides/celery/crons/) documentation. |
| 12 | + |
| 13 | + Usage: |
| 14 | + |
| 15 | + ```python |
| 16 | + from celery import Celery, signals |
| 17 | + from celery.schedules import crontab |
| 18 | + |
| 19 | + import sentry_sdk |
| 20 | + from sentry_sdk.integrations.celery import CeleryIntegration |
| 21 | + |
| 22 | + |
| 23 | + app = Celery('tasks', broker='...') |
| 24 | + app.conf.beat_schedule = { |
| 25 | + 'set-in-beat-schedule': { |
| 26 | + 'task': 'tasks.some_important_task', |
| 27 | + 'schedule': crontab(...), |
| 28 | + }, |
| 29 | + } |
| 30 | + |
| 31 | + |
| 32 | + @signals.celeryd_init.connect |
| 33 | + def init_sentry(**kwargs): |
| 34 | + sentry_sdk.init( |
| 35 | + dsn='...', |
| 36 | + integrations=[CeleryIntegration(monitor_beat_tasks=True)], # 👈 here |
| 37 | + environment="local.dev.grace", |
| 38 | + release="v1.0", |
| 39 | + ) |
| 40 | + ``` |
| 41 | + |
| 42 | + This will auto detect all schedules tasks in your `beat_schedule` and will monitor them with Sentry [Crons](https://blog.sentry.io/2023/01/04/cron-job-monitoring-beta-because-scheduled-jobs-fail-too/). |
| 43 | + |
| 44 | +- **New:** [gRPC](https://grpc.io/) integration (#1911) by @hossein-raeisi |
| 45 | + |
| 46 | + The [gRPC](https://grpc.io/) integration instruments all incoming requests and outgoing unary-unary, unary-stream grpc requests using grpcio channels. |
| 47 | + |
| 48 | + To learn more see our [gRPC Integration](https://docs.sentry.io/platforms/python/configuration/integrations/grpc/) documentation. |
| 49 | + |
| 50 | + On the server: |
| 51 | + |
| 52 | + ```python |
| 53 | + import grpc |
| 54 | + from sentry_sdk.integrations.grpc.server import ServerInterceptor |
| 55 | + |
| 56 | + |
| 57 | + server = grpc.server( |
| 58 | + thread_pool=..., |
| 59 | + interceptors=[ServerInterceptor()], |
| 60 | + ) |
| 61 | + ``` |
| 62 | + |
| 63 | + On the client: |
| 64 | + |
| 65 | + ```python |
| 66 | + import grpc |
| 67 | + from sentry_sdk.integrations.grpc.client import ClientInterceptor |
| 68 | + |
| 69 | + |
| 70 | + with grpc.insecure_channel("example.com:12345") as channel: |
| 71 | + channel = grpc.intercept_channel(channel, *[ClientInterceptor()]) |
| 72 | + |
| 73 | + ``` |
| 74 | + |
| 75 | +- **New:** socket integration (#1911) by @hossein-raeisi |
| 76 | + |
| 77 | + Use this integration to create spans for DNS resolves (`socket.getaddrinfo()`) and connection creations (`socket.create_connection()`). |
| 78 | + |
| 79 | + To learn more see our [Socket Integration](https://docs.sentry.io/platforms/python/configuration/integrations/socket/) documentation. |
| 80 | + |
| 81 | + Usage: |
| 82 | + |
| 83 | + ```python |
| 84 | + import sentry_sdk |
| 85 | + from sentry_sdk.integrations.socket import SocketIntegration |
| 86 | + sentry_sdk.init( |
| 87 | + dsn="___PUBLIC_DSN___", |
| 88 | + integrations=[ |
| 89 | + SocketIntegration(), |
| 90 | + ], |
| 91 | + ) |
| 92 | + ``` |
| 93 | + |
| 94 | +- Fix: Do not trim span descriptions. (#1983) by @antonpirker |
10 | 95 |
|
11 | 96 | ## 1.18.0
|
12 | 97 |
|
|
0 commit comments