Hi, I have a fastapi application and I am saving t...
# general
f
Hi, I have a fastapi application and I am saving the uvicorn logs to a file and added the filelog receiver to
otel-collector-config.yaml
using this guide https://signoz.io/docs/userguide/collect_logs_from_file/ . But my logs don't have trace_id and span_id. I want to correlate my logs with their traces. I am not sure how to do this. Your help will be appreciated.
f
I have set
OTEL_PYTHON_LOG_CORRELATION
to true in my fastapi application environment and also set the format as %(asctime)s %(levelname)s [%(name)s] [%(filename)s:%(lineno)d] [trace_id=%(otelTraceID)s span_id=%(otelSpanID)s resource.service.name=%(otelServiceName)s trace_sampled=%(otelTraceSampled)s] - %(message)s. I am getting this error:
Copy code
ValueError: Formatting field not found in record: 'otelTraceID'
@Srikanth Chekuri can you please help?
t
I have the same issue. Did you manage to solve the issue @fahad yamin?