Andree
Andree

Reputation: 1199

Dapr logs export to Azure Monitor

We have Azure API Management self-hosted on Azure Kubernetes Services. As we need to collect the logs from the container for monitoring purposes (some of the logs are sent to stdout only and not to the Application Insights). For this reason, we've enabled Dapr to collect the logs from stdout in values.yaml file:

dapr:
  enabled: true
  app:
    id: apim-test-scus
  config: tracing
  logging:
    useJsonOutput: true
    level: debug

But we are facing issues sending the logs to Azure Monitor. We've tried to use the Open Telemetry Collector but it only collects the traces, but not the logs.

ConfigMap of Open Telemetry Collector:

receivers:
  otlp:
    protocols:
      grpc:
      http:
  zipkin:
    endpoint: 0.0.0.0:9411

processors:
  batch:

exporters:
  azuremonitor:
    instrumentation_key: *****************
  logging:
    loglevel: info
extensions:
  health_check:
  pprof:
    endpoint: :1888
  zpages:
    endpoint: :55679

service:
  extensions: [pprof, zpages, health_check]
  pipelines:
    traces:
      receivers: [zipkin]
      processors: [batch]
      exporters: [logging, azuremonitor]
    logs:
      receivers: [otlp]
      processors: []
      exporters: [logging, azuremonitor]

But it seems like the Dapr doesn't send the data using the Open Telemetry Protocol. We can see the logs in the Dapr Dashboard but the Open Telemetry Collector doesn't receive any logs from Dapr.

Is it possible to send the logs from Dapr to Open Telemetry Collector using otlp or other protocol?

Upvotes: 1

Views: 285

Answers (1)

Observability-guy
Observability-guy

Reputation: 21

This question is a bit old so apologies if you have already resolved it.

As far as I know, Dapr captures and displays output from stdout, but it doesn't actually emit those logs for other tools to collect. The simplest solution would be to install FluentD on your cluster and configure it to forward logs to your collector.

There is actually guidance on setting up FluentD with Dapr in the Dapr Docs.

Unfortunately, those docs configure FluentD to export to an Elasticsearch endpoint - so you will need to update the configuration in fluentd-config-map.yaml to define a 'match' for your OpenTelemetry collector.

Upvotes: 2

Related Questions