-
Notifications
You must be signed in to change notification settings - Fork 66
Open
Description
Hi Folks,
I am trying to use Loki + Tempo but when I check my logs in Loki the trace_id and span_id are missing.
Code related to logging:
[...]
from opentelemetry.instrumentation.logging import LoggingInstrumentor
from logging_loki import LokiHandler, emitter
emitter.LokiEmitter.level_tag = "level"
LoggingInstrumentor().instrument(set_logging_format=True)
handler = LokiHandler(
url="http://ipadpi.local:3100/loki/api/v1/push",
tags={"application": "backend"},
version="1",
)
logger = logging.getLogger(__name__)
logger.addHandler(handler)
logger.setLevel(logging.DEBUG)
[...]
@app.get("/test")
async def test():
logger.info(
"Info em test2",
extra={"tags": {"service": "backend"}},
)
return Status(message='test!')The result in loki is:
and I am running my uvicorn using:
opentelemetry-instrument uvicorn main:app
What am I missing here?
Metadata
Metadata
Assignees
Labels
No labels
