Ingesting logs using Grafana Loki push API
You can receive logs from Grafana Agent or Promtail using the OpenTelemetry Collector Loki receiver and then export the data to Uptrace using the OpenTelemetry protocol.
OpenTelemetry Collector is a proxy service between your application and a distributed tracing tool. Collector receives telemetry data, transforms the data, and then exports it to tracing tools that can store the data permanently.
Collector can also act as an agent that pulls telemetry data from monitored systems, for example, Redis or filesystem metrics.
To receive logs from Promtail and export them to Uptrace, add the following to your OpenTelemetry Collector configuration file:
receivers: loki: protocols: http: grpc: use_incoming_timestamp: true exporters: otlp/uptrace: endpoint: otlp.uptrace.dev:4317 headers: uptrace-dsn: 'https://firstname.lastname@example.org/project_id' processors: batch: service: pipelines: logs: receivers: [loki] processors: [batch] exporters: [otlp/uptrace]
receivers: loki: protocols: http: grpc: use_incoming_timestamp: true exporters: otlp/uptrace: endpoint: localhost:14317 tls: insecure: true headers: uptrace-dsn: 'http://project2_secret_token@localhost:14317/2' service: pipelines: logs: receivers: [loki] processors: [batch] exporters: [otlp/uptrace]
You can then configure Promtail to export data to OpenTelemetry Collector:
clients: - url: http://otelcol:3500/loki/api/v1/push