feat: add otel system metrics instrumentation (#22265)
This commit is contained in:
@@ -20,6 +20,7 @@ from opentelemetry.instrumentation.redis import RedisInstrumentor
|
|||||||
from opentelemetry.instrumentation.requests import RequestsInstrumentor
|
from opentelemetry.instrumentation.requests import RequestsInstrumentor
|
||||||
from opentelemetry.instrumentation.sqlalchemy import SQLAlchemyInstrumentor
|
from opentelemetry.instrumentation.sqlalchemy import SQLAlchemyInstrumentor
|
||||||
from opentelemetry.instrumentation.aiohttp_client import AioHttpClientInstrumentor
|
from opentelemetry.instrumentation.aiohttp_client import AioHttpClientInstrumentor
|
||||||
|
from opentelemetry.instrumentation.system_metrics import SystemMetricsInstrumentor
|
||||||
from opentelemetry.trace import Span, StatusCode
|
from opentelemetry.trace import Span, StatusCode
|
||||||
from redis import Redis
|
from redis import Redis
|
||||||
from redis.cluster import RedisCluster
|
from redis.cluster import RedisCluster
|
||||||
@@ -204,6 +205,7 @@ class Instrumentor(BaseInstrumentor):
|
|||||||
request_hook=aiohttp_request_hook,
|
request_hook=aiohttp_request_hook,
|
||||||
response_hook=aiohttp_response_hook,
|
response_hook=aiohttp_response_hook,
|
||||||
)
|
)
|
||||||
|
SystemMetricsInstrumentor().instrument()
|
||||||
|
|
||||||
def _uninstrument(self, **kwargs):
|
def _uninstrument(self, **kwargs):
|
||||||
if getattr(self, "instrumentors", None) is None:
|
if getattr(self, "instrumentors", None) is None:
|
||||||
|
|||||||
@@ -155,3 +155,4 @@ opentelemetry-instrumentation-requests==0.60b1
|
|||||||
opentelemetry-instrumentation-logging==0.60b1
|
opentelemetry-instrumentation-logging==0.60b1
|
||||||
opentelemetry-instrumentation-httpx==0.60b1
|
opentelemetry-instrumentation-httpx==0.60b1
|
||||||
opentelemetry-instrumentation-aiohttp-client==0.60b1
|
opentelemetry-instrumentation-aiohttp-client==0.60b1
|
||||||
|
opentelemetry-instrumentation-system-metrics==0.60b1
|
||||||
|
|||||||
Reference in New Issue
Block a user