-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sending front end logs with "fields" attribute results in a 400 (on Vercel) #121
Comments
hmmm, that should be fine, the payload looks correct to me. can you provide more info on
|
@schehata Thanks for taking a look. In our Package.json:
And in PNPM lock:
This is using the Vercel Axiom integration. We created the integration a few months ago, so perhaps I need to do it again? The 400 does not give a description of the error, just an empty {} in the body. Other log lines are working, so the credentials supplied by the Axiom integration appear to be correct. Anything that does not contain this second argument seems to be accepted fine: I thought this could potentially be Cloudflare blocking the /_axiom route because we have Cloudflare in front of the web app. But I've also tested on a Vercel preview and have the same issue. Sometimes the logs send multiple log lines as an array. If any of those lines has a value for the "fields" key then the entire request will fail. |
Hi folks, we are still experiencing this and are unable to rely on Axiom for logs. Can anyone help here? I'm happy to give you access to an account on our web app to see what's going on. |
hi @stefl , I am sorry that you are facing such problems that is affecting your experience using Axiom. I have been trying to reproduce this but I couldn't. I have tried just now to send some logs with the second argument and it worked fine. I took this back to the team, and I will hopefully get back with answers. The only guess I have at the moment is the number of columns you are sending, there is a limit of number of columns that could be saved, but otherwise the json you showed looks fine to me. |
@stefl hey, does this problem persist? can you check the response of |
Having the same problem. The response of _axiom/logs returns "bad request". When removing the this variable (on localhost) and everything works fine. What I'm trying to do is to log browser errors, next to having the Vercel integration logs |
I am wondering if this is happening because you reach Axiom's fields limit of your accounts? |
I am seeing repeated 400 errors with axiom logs for front-end logs in production.
For instance, this call (where connectors is an empty array):
log.debug("getConnectors", { connectors });
Generates a request with this body
'[{"level":"debug","message":"getConnectors","_time":"2023-05-24T10:02:53.039Z","fields":{"connectors":[]},"vercel":{"environment":"production","source":"frontend"}}]'
This throws a 400 and returns {}.
If I manually trigger this same request using curl using this body:
'[{"level":"debug","message":"getConnectors","_time":"2023-05-24T10:02:53.039Z","vercel":{"environment":"production","source":"frontend"}}]'
I get a 200 back.
If I send a message that generates this body, everything is also fine:
[{"level":"debug","message":"Page loaded /my/path","_time":"2023-05-24T10:02:46.300Z","fields":{},"vercel":{"environment":"preview","source":"frontend"}}]
Is it not possible to log a Javascript object/array to Axiom or is this a bug?
The text was updated successfully, but these errors were encountered: