DataDog/agent-github-action

[question] Does this action support send application logs to Datadog ?

Niceplace opened this issue · 3 comments

Use case: I have a NodeJS application configured with dd-trace. It is a CLI app that runs in a Github Action workflow on a schedule. I was able to setup a datadog agent using this project and I can see some APM/Traces being sent successfully but what I really want is logs.

I am trying to activate log collection in the agent via DD_LOGS_ENABLED env variable but I'm not sure if I'm doing it right, or if it's supported at all.

Here's how I set it up:

jobs:
  sync_metrics:
    runs-on: [self-hosted, universal]
    steps:
      - uses: datadog/agent-github-action@v1
        with:
            api_key: ${{ secrets.DD_API_KEY }}
            datadog_site: 'datadoghq.eu'
        env:
          DD_LOGS_ENABLED: true

      // Removed some steps that checkout the code, setup the node...etc. to simplify the example

      - name: Sync metrics
        run: yarn start sync ${{ github.event.inputs.args || 'all' }}
        env:
          DD_TRACE_ENABLED: 'true'
          DD_TRACE_VERSION: ${{ github.sha }}

Any pointers ? Cheers ! :D

Hello @Niceplace,

The main use case of this action is to start a Datadog agent to trace tests as highlighted in the DataDog docs. It was not originally meant to do log collection. That being said, I can try and explore this use case and see if it can added.

Hello 👋 sorry for the late update.

We had a look at the log collection use case and it is not as simple as just passing the env DD_LOGS_ENABLED=true to the agent. It also requires specific configuration depending on your application, see https://docs.datadoghq.com/agent/logs/?tab=tailfiles#custom-log-collection.

This is not the main use case of this action but it can be achieved by configuring the agent yourself and setting the needed configuration.

Thanks for the update :) I ended up going on a multi-day binge to configure log collection through any means possible and I ended up having something working with a vanilla docker agent so I guess I ended up doing the right thing.

Cheers !