The issues seems to have been resolved by using VPN for now. Thanks for the amazing support!
I changed network but the issue remains. Here's a trace from debug logs:
DEBUG:openai._base_client:request_id: ef1ee995-3923-4d06-9e9c-6f3d7e5d780
WARNING:opentelemetry.exporter.otlp.proto.grpc.exporter:Transient error StatusCode.DEADLINE_EXCEEDED encountered while exporting traces to otlp.arize.com, retrying in 1s.
I0515 01:28:42.871804516 901705 subchannel.cc:744] subchannel 0x95e8ca0 {address=ipv4:51.222.12.245:8080, args={grpc.client_channel_factory=0x9054300, grpc.default_authority=otlp.arize.com, grpc.http2_scheme=https, grpc.http_connect_server=otlp.arize.com:443, grpc.internal.channel_credentials=0x86ccf60, grpc.internal.event_engine=0x95f74a0, grpc.internal.security_connector=0x961b590, grpc.internal.subchannel_pool=0x90980f0, grpc.primary_user_agent=grpc-python/1.63.0, grpc.resource_quota=0x9098fb0, grpc.server_uri=dns:///otlp.arize.com}}: connect failed (UNKNOWN:Failed to connect to remote host: FD Shutdown {target_address:"ipv4:51.222.12.245:8080", created_time:"2024-05-15T01:28:42.871652548+05:00", os_error:"Timeout occurred", children:[UNKNOWN:connect() timed out {created_time:"2024-05-15T01:28:42.871628483+05:00"}]}), backing off for -19000 ms
I0515 01:28:42.871905297 901715 subchannel.cc:699] subchannel 0x95e8ca0 {address=ipv4:51.222.12.245:8080, args={grpc.client_channel_factory=0x9054300, grpc.default_authority=otlp.arize.com, grpc.http2_scheme=https, grpc.http_connect_server=otlp.arize.com:443, grpc.internal.channel_credentials=0x86ccf60, grpc.internal.event_engine=0x95f74a0, grpc.internal.security_connector=0x961b590, grpc.internal.subchannel_pool=0x90980f0, grpc.primary_user_agent=grpc-python/1.63.0, grpc.resource_quota=0x9098fb0, grpc.server_uri=dns:///otlp.arize.com}}: backoff delay elapsed, reporting IDLE
WARNING:opentelemetry.exporter.otlp.proto.grpc.exporter:Transient error StatusCode.UNAVAILABLE encountered while exporting traces to otlp.arize.com, retrying in 2s.
WARNING:opentelemetry.exporter.otlp.proto.grpc.exporter:Transient error StatusCode.UNAVAILABLE encountered while exporting traces to otlp.arize.com, retrying in 4s.
WARNING:opentelemetry.exporter.otlp.proto.grpc.exporter:Transient error StatusCode.UNAVAILABLE encountered while exporting traces to otlp.arize.com, retrying in 8s.
WARNING:opentelemetry.exporter.otlp.proto.grpc.exporter:Transient error StatusCode.UNAVAILABLE encountered while exporting traces to otlp.arize.com, retrying in 16s.
I0515 01:29:02.871866782 901705 subchannel.cc:744] subchannel 0x95e8ca0 {address=ipv4:51.222.12.245:8080, args={grpc.client_channel_factory=0x9054300, grpc.default_authority=otlp.arize.com, grpc.http2_scheme=https, grpc.http_connect_server=otlp.arize.com:443, grpc.internal.channel_credentials=0x86ccf60, grpc.internal.event_engine=0x95f74a0, grpc.internal.security_connector=0x961b590, grpc.internal.subchannel_pool=0x90980f0, grpc.primary_user_agent=grpc-python/1.63.0, grpc.resource_quota=0x9098fb0, grpc.server_uri=dns:///otlp.arize.com}}: connect failed (UNKNOWN:Failed to connect to remote host: FD Shutdown {target_address:"ipv4:51.222.12.245:8080", created_time:"2024-05-15T01:29:02.871616698+05:00", os_error:"Timeout occurred", children:[UNKNOWN:connect() timed out {created_time:"2024-05-15T01:29:02.871590919+05:00"}]}), backing off for -18240 ms
I0515 01:29:02.871996497 901713 subchannel.cc:699] subchannel 0x95e8ca0 {address=ipv4:51.222.12.245:8080, args={grpc.client_channel_factory=0x9054300, grpc.default_authority=otlp.arize.com, grpc.http2_scheme=https, grpc.http_connect_server=otlp.arize.com:443, grpc.internal.channel_credentials=0x86ccf60, grpc.internal.event_engine=0x95f74a0, grpc.internal.security_connector=0x961b590, grpc.internal.subchannel_pool=0x90980f0, grpc.primary_user_agent=grpc-python/1.63.0, grpc.resource_quota=0x9098fb0, grpc.server_uri=dns:///otlp.arize.com}}: backoff delay elapsed, reporting IDLE
WARNING:opentelemetry.exporter.otlp.proto.grpc.exporter:Transient error StatusCode.UNAVAILABLE encountered while exporting traces to otlp.arize.com, retrying in 32s.
I0515 01:29:22.871768938 901705 subchannel.cc:744] subchannel 0x95e8ca0 {address=ipv4:51.222.12.245:8080, args={grpc.client_channel_factory=0x9054300, grpc.default_authority=otlp.arize.com, grpc.http2_scheme=https, grpc.http_connect_server=otlp.arize.com:443, grpc.internal.channel_credentials=0x86ccf60, grpc.internal.event_engine=0x95f74a0, grpc.internal.security_connector=0x961b590, grpc.internal.subchannel_pool=0x90980f0, grpc.primary_user_agent=grpc-python/1.63.0, grpc.resource_quota=0x9098fb0, grpc.server_uri=dns:///otlp.arize.com}}: connect failed (UNKNOWN:Failed to connect to remote host: FD Shutdown {target_address:"ipv4:51.222.12.245:8080", created_time:"2024-05-15T01:29:22.871595901+05:00", os_error:"Timeout occurred", children:[UNKNOWN:connect() timed out {created_time:"2024-05-15T01:29:22.871570072+05:00"}]}), backing off for -17655 ms
I0515 01:29:22.871875971 901708 subchannel.cc:699] subchannel 0x95e8ca0 {address=ipv4:51.222.12.245:8080, args={grpc.client_channel_factory=0x9054300, grpc.default_authority=otlp.arize.com, grpc.http2_scheme=https, grpc.http_connect_server=otlp.arize.com:443, grpc.internal.channel_credentials=0x86ccf60, grpc.internal.event_engine=0x95f74a0, grpc.internal.security_connector=0x961b590, grpc.internal.subchannel_pool=0x90980f0, grpc.primary_user_agent=grpc-python/1.63.0, grpc.resource_quota=0x9098fb0, grpc.server_uri=dns:///otlp.arize.com}}: backoff delay elapsed, reporting IDLE Thanks Nate
yes I could do that.
Directly from my machine. even used VPN once. I can try from different network as well but i already pushed some traces previoulsy from the same network.
Thanks a lot for the quick response. I've already upgraded openai to latest version but same result. Honestly it's a bit of frustration as it was working and it still works on my deployment environment in aws. Same branch, same code and it does not work locally. I need to develop and test locally . Would really appreciate this can be investigated quickly. Thanks again
David Monical any guesses? could it be due to openai version? Is there a goegraphical restriction on the service? But it was working just fine some days ago
The code is pretty straightforward David. I'm using AzureOpenai for tracing. The quantity of logs isn't too much at the moment. I'm just trying it out.
Thanks David. Looking forward to it.
def setup_arize_client() -> trace_api.Tracer:
# Set the Space and API keys as headers for authentication
headers = f"space_key={ARIZE_SPACE_KEY},api_key={ARIZE_API_KEY}"
os.environ['OTEL_EXPORTER_OTLP_TRACES_HEADERS'] = headers
# Set resource attributes for the name and version for your application
trace_attributes = {
"model_id": TRACING_PROJECT_NAME, # This is how your model will show up in Arize
"model_version": MODEL_VERSION, # You can filter your spans by model version in Arize
}
span_exporter = OTLPSpanExporter(endpoint=ARIZE_ENDPOINT)
tracer_provider = trace_sdk.TracerProvider(
resource=Resource(attributes=trace_attributes)
)
tracer_provider.add_span_processor(
SimpleSpanProcessor(
span_exporter=span_exporter
)
)
trace_api.set_tracer_provider(tracer_provider=tracer_provider)
tracer = trace_api.get_tracer(__name__)
OpenAIInstrumentor().instrument()
return tracer
async def execute_in_span(span_name: str, execute_operation: callable, operation_params: dict, tracer: trace_api.Tracer,
additional_attributes: dict = None, send_span: bool = False) -> Any:
with tracer.start_as_current_span(span_name) as span:
# Filter out sensitive keys from operation parameters before logging them as span attributes
operation_params_filtered = {k: v for k, v in operation_params.items() if
k not in ['tracer']}
span_attributes = {
SpanAttributes.INPUT_VALUE: {
'input': {**operation_params_filtered}
}
}
# Merge additional attributes if provided
if additional_attributes:
span_attributes.update(additional_attributes)
# Inject the current span into operation parameters if requested
if send_span:
operation_params['span'] = span
set_span_attributes(span, span_attributes)
add_span_event(span, f"Starting the {span_name.lower()} process.")
start_time = perf_counter()
result = await execute_operation(**operation_params)
execution_time = perf_counter() - start_time
add_span_event(span, f"{span_name} process completed in {execution_time:.2f} seconds.")
# Capture the operation's result as the span's output value
output_attributes = {
SpanAttributes.OUTPUT_VALUE: {'output': result}
}
set_span_attributes(span, output_attributes)
return result
def add_span_event(span: Span, message: str) -> None:
span.add_event(message)
def set_span_attributes(span: Span, attributes: Dict[Any, Any]):
for attr, value in attributes.items():
# Automatically assign MIME type for input and output values if not explicitly provided
if attr.endswith(".value") and (
SpanAttributes.INPUT_MIME_TYPE not in attributes and SpanAttributes.OUTPUT_MIME_TYPE not in attributes):
mime_type_key = SpanAttributes.INPUT_MIME_TYPE if 'input' in attr else SpanAttributes.OUTPUT_MIME_TYPE
span.set_attribute(mime_type_key, OpenInferenceMimeTypeValues.JSON.value)
span.set_attribute(attr, json.dumps(value) if isinstance(value, Dict) else value)
# Set the span kind to 'chain' for all spans processed by this function
span.set_attribute(SpanAttributes.OPENINFERENCE_SPAN_KIND, OpenInferenceSpanKindValues.CHAIN.value)
from openinference.instrumentation.openai import OpenAIInstrumentor
from opentelemetry import trace as trace_api
from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter
from opentelemetry.sdk import trace as trace_sdk
from opentelemetry.sdk.resources import Resource
from opentelemetry.sdk.trace.export import SimpleSpanProcessor
from opentelemetry import trace as trace_api
from openinference.semconv.trace import OpenInferenceSpanKindValues, SpanAttributes, OpenInferenceMimeTypeValues
from opentelemetry.trace import Span
ARIZE_SPACE_KEY = os.environ["ARIZE_SPACE_KEY"]
ARIZE_API_KEY = os.environ["ARIZE_API_KEY"]
TRACING_PROJECT_NAME = "proj-name"
MODEL_VERSION = "1.0"
ARIZE_ENDPOINT = "https://otlp.arize.com/v1"
execute_in_span is called on any function which needs tracing
I'm still unable to get it working atm Sharing code in a moment
Is it something I should be concerned about?
