Skip to content

Losing Logs record fields #620

@natepage

Description

@natepage

Hi there! 👋

We've recently managed to make our PHP based Lambda function work with:

  • ddtrace-php sidecar trace sender feature on
  • next-gen v75 lambda extension

Everything seems to be working fine, we get both traces and logs in Datadog, however they are not correlated. After investigation, I believe it is something to do with "losing logs data" somewhere in the process.

Our application is a PHP Symfony app, using Monolog as logger and have logs injection turned on, and we do log as JSON, so here is a typical log record in Cloudwatch:

{
    "message": "Read existing security token from the session.",
    "context": {
        "key": "_security_admin",
        "token_class": "Symfony\\Component\\Security\\Http\\Authenticator\\Token\\PostAuthenticationToken",
        "dd.trace_id": "13204366237012237818",
        "dd.span_id": "15763279168591393237",
        "dd.service": "notifications-api",
        "dd.version": "f8f423a934f5893992413072f2527cd6ff63bf11",
        "dd.env": "dev"
    },
    "level": 100,
    "level_name": "DEBUG",
    "channel": "security",
    "datetime": "2025-03-25T01:48:57.102952+00:00",
    "extra": {
        "X-CORRELATION-ID": "1f0091b5-0ac1-6a6e-9e44-c9dbdb3c4b5e",
        "X-REQUEST-ID": "1f0091b5-0ac1-6b36-8acf-c9dbdb3c4b5e"
    }
}

However when looking at this same record in Datadog console, information is missing:
Image

I would expect to see the context at least in Datadog console,
Because we are using PHP which isn't natively supported on Lambda, do we need an additional setup?
Or are we simply missing something? 😄

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions