Skip to content

Commit

Permalink
fix: remove broken non-asyncio prometheus grpc server interceptor (#3065
Browse files Browse the repository at this point in the history
)
  • Loading branch information
RogerHYang committed May 3, 2024
1 parent 3447f70 commit af75151
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/phoenix/server/grpc_server.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import TYPE_CHECKING, Any, Awaitable, Callable, Optional
from typing import TYPE_CHECKING, Any, Awaitable, Callable, List, Optional

import grpc
from grpc.aio import RpcContext, Server
from grpc.aio import RpcContext, Server, ServerInterceptor
from opentelemetry.proto.collector.trace.v1.trace_service_pb2 import (
ExportTraceServiceRequest,
ExportTraceServiceResponse,
Expand Down Expand Up @@ -58,11 +58,13 @@ def __init__(
self._enable_prometheus = enable_prometheus

async def __aenter__(self) -> None:
interceptors = []
interceptors: List[ServerInterceptor] = []
if self._enable_prometheus:
from py_grpc_prometheus.prometheus_server_interceptor import PromServerInterceptor

interceptors.append(PromServerInterceptor())
...
# TODO: convert to async interceptor
# from py_grpc_prometheus.prometheus_server_interceptor import PromServerInterceptor
#
# interceptors.append(PromServerInterceptor())
if self._tracer_provider is not None:
from opentelemetry.instrumentation.grpc import GrpcAioInstrumentorServer

Expand Down

0 comments on commit af75151

Please sign in to comment.