I have Vercel’s integration setup in Datadog. My logs do stream through, but the log output just seems to be plaintext:
START RequestId: 9ea605db-6150-49c4-ab16-5401722a988a Version: $LATEST
{"level":30,"time":1724401439773,"pid":3,"hostname":"XXX","message":"This is a test info","method":"createSession"}
{"level":40,"time":1724401439774,"pid":3,"hostname":"XXX","message":"This is a test warning","method":"createSession"}
END RequestId: 9ea605db-6150-49c4-ab16-5401722a988a
REPORT RequestId: 9ea605db-6150-49c4-ab16-5401722a988a Duration: 227.29 ms Billed Duration: 228 ms Memory Size: 1769 MB Max Memory Used: 260 MB
Datadog logs this with status OK at INFO level with the log in plaintext so I can’t extract the attributes.
I understand you’re having some trouble with your logs coming through as plaintext instead of parsed JSON. That can definitely make it harder to extract and analyze specific attributes, but no worries—let’s see what we can do to help!
Here are a few things you might want to check out:
Log Source Selection: Vercel lets you choose which log sources are sent to your log drain. Make sure you’ve selected the ones that best suit your needs, like static, lambda, edge, build, or external.
Log Format: It looks like your logs contain JSON data within the plaintext output. The lines starting with {"level":...} are valid JSON, but they might be mixed in with other non-JSON lines (like START, END, and REPORT), which could be causing some parsing issues.
Datadog Pipeline: You might want to set up a custom processing pipeline in Datadog to handle these logs more effectively. Since the JSON is valid within the plaintext, you could try using Datadog’s Grok Parser or JSON Parser to pull out the information you need.
Vercel Configuration: Unfortunately, there’s no built-in option to change the log format on the Vercel side for Datadog integration at the moment.