From d6d9724c8655a667923859c87ac609e6729ce650 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luismi=20Rami=CC=81rez?= Date: Tue, 18 Jun 2024 11:55:49 +0200 Subject: [PATCH] Add support for Pika Add instrumentation support for Pika messages. The global messaging extractor already covers the cases this instrumentation adds, so there's no need for a specific extractor so far. --- .changesets/add-support-for-pika.md | 6 ++++++ src/appsignal/config.py | 1 + src/appsignal/opentelemetry.py | 7 +++++++ 3 files changed, 14 insertions(+) create mode 100644 .changesets/add-support-for-pika.md diff --git a/.changesets/add-support-for-pika.md b/.changesets/add-support-for-pika.md new file mode 100644 index 00000000..48911b1b --- /dev/null +++ b/.changesets/add-support-for-pika.md @@ -0,0 +1,6 @@ +--- +bump: patch +type: add +--- + +Add support for Pika diff --git a/src/appsignal/config.py b/src/appsignal/config.py index 709a7728..f45c8cc4 100644 --- a/src/appsignal/config.py +++ b/src/appsignal/config.py @@ -104,6 +104,7 @@ class Config: "opentelemetry.instrumentation.jinja2", "opentelemetry.instrumentation.mysql", "opentelemetry.instrumentation.mysqlclient", + "opentelemetry.instrumentation.pika", "opentelemetry.instrumentation.psycopg", "opentelemetry.instrumentation.psycopg2", "opentelemetry.instrumentation.pymysql", diff --git a/src/appsignal/opentelemetry.py b/src/appsignal/opentelemetry.py index 9b953f80..b8522d27 100644 --- a/src/appsignal/opentelemetry.py +++ b/src/appsignal/opentelemetry.py @@ -103,6 +103,12 @@ def add_mysqlclient_instrumentation() -> None: MySQLClientInstrumentor().instrument() +def add_pika_instrumentation() -> None: + from opentelemetry.instrumentation.pika import PikaInstrumentor + + PikaInstrumentor().instrument() + + def add_psycopg2_instrumentation() -> None: from opentelemetry.instrumentation.psycopg2 import Psycopg2Instrumentor @@ -158,6 +164,7 @@ def add_sqlite3_instrumentation() -> None: "opentelemetry.instrumentation.jinja2": add_jinja2_instrumentation, "opentelemetry.instrumentation.mysql": add_mysql_instrumentation, "opentelemetry.instrumentation.mysqlclient": add_mysqlclient_instrumentation, + "opentelemetry.instrumentation.pika": add_pika_instrumentation, "opentelemetry.instrumentation.psycopg2": add_psycopg2_instrumentation, "opentelemetry.instrumentation.psycopg": add_psycopg_instrumentation, "opentelemetry.instrumentation.pymysql": add_pymysql_instrumentation,