1
0
Fork 0

Merge pull request #2795 from WesleyAC/add-postgres-instrumentation

Add automatic instrumentation to Postgres queries
This commit is contained in:
Mouse Reeve 2023-04-07 06:39:47 -07:00 committed by GitHub
commit 035ca6fec2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 0 deletions

View file

@ -40,6 +40,7 @@ class BookwyrmConfig(AppConfig):
from bookwyrm.telemetry import open_telemetry
open_telemetry.instrumentDjango()
open_telemetry.instrumentPostgres()
if settings.ENABLE_PREVIEW_IMAGES and settings.FONTS:
# Download any fonts that we don't have yet

View file

@ -22,6 +22,12 @@ def instrumentDjango():
DjangoInstrumentor().instrument()
def instrumentPostgres():
from opentelemetry.instrumentation.psycopg2 import Psycopg2Instrumentor
Psycopg2Instrumentor().instrument()
def instrumentCelery():
from opentelemetry.instrumentation.celery import CeleryInstrumentor
from celery.signals import worker_process_init