Can I use promtail to collect logs and tracing in Tempo?

I use the example on grafana github, but I want to collect the localhost /var/log and view logs on loki and get traceID (example only show container log), Is there a yaml for reference?

I have successfully used promtail to collect localhost log and send it to loki but I don’t know how to add traceID

promtail does not collect traces. If you would like to collect traces you need to instrument your application (or use a form of auto-instrumentation) and push the data to a tracing backend.

some information here:

were you able to resolve this?

what about other agents @joeelliott which collects the traceID as well?
or is it, you won’t be able to collect traces until its integrated on the application itself?

That’s it. You first need to instrument your application with a tracing library and start generating the data. Then, traceID or any other relevant field related to traces can be injected into the logs.

For instrumentation libraries, we recommend that you take a look at OpenTelemetry. They offer support in most widely used languages.