Skip to content
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

debug netlify site and deploy env vars #85

Merged
merged 9 commits into from
Dec 1, 2022
Merged

Conversation

schehata
Copy link
Collaborator

No description provided.

@vercel
Copy link

vercel bot commented Nov 30, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
next-axiom-example ✅ Ready (Inspect) Visit Preview Dec 1, 2022 at 2:27PM (UTC)

@schehata
Copy link
Collaborator Author

example for netlify edge function logs:

cannot find siteId env variable

{
  "fields": {
    "author": "Islam"
  },
  "level": "warn",
  "message": "should contain request info",
  "netlify": {
    "buildId": "6387728773fe310c857556c0",
    "context": "production",
    "deploymentId": "F43iLevqndxjdulDt5BCcFo1h343fIsSCanp3ACubfs=",
    "deploymentUrl": "https://6387728773fe310c857556c2--axiom-local-next.netlify.app",
    "environment": "production",
    "region": "eu-central",
    "source": "edge-log"
  },
  "request": {
    "host": "axiom-local-next.netlify.app",
    "ip": "***",
    "method": "GET",
    "path": "/api/edge-func",
    "region": "C",
    "scheme": "https",
    "startTime": 1669821267786,
    "statusCode": 200,
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15"
  }
}

@schehata
Copy link
Collaborator Author

example for notify lambda-log, looks great:

{
  "fields": {
    "url": "/api/hello"
  },
  "level": "info",
  "message": "Hello from function",
  "netlify": {
    "buildId": "6387728773fe310c857556c0",
    "context": "production",
    "deploymentId": "6387728773fe310c857556c2",
    "deploymentUrl": "https://6387728773fe310c857556c2--axiom-local-next.netlify.app",
    "environment": "production",
    "region": "us-east-1",
    "siteId": "c1d6b6ae-dc40-497a-8687-5a9d1f73ab03",
    "source": "lambda-log"
  },
  "request": {
    "host": "axiom-local-next.netlify.app",
    "ip": "***",
    "method": "GET",
    "path": "/api/hello",
    "scheme": "https",
    "startTime": 1669821355671,
    "statusCode": 200,
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15"
  }
}

@schehata
Copy link
Collaborator Author

example for netlify webVital log:

  • no siteId
  • startTime looks weird
  • no request ip or path (probably path could be added?)
{
  "netlify": {
    "buildId": "6387728773fe310c857556c0",
    "context": "production",
    "deploymentId": "6387728773fe310c857556c2",
    "deploymentUrl": "https://6387728773fe310c857556c2--axiom-local-next.netlify.app",
    "environment": "production",
    "source": "web-vital"
  },
  "webVital": {
    "id": "v2-1669821543856-4328093251255",
    "label": "web-vital",
    "name": "FCP",
    "route": "/",
    "startTime": 534,
    "value": 534
  }
}

@schehata
Copy link
Collaborator Author

verbal frontend-log:

{
  "fields": {
    "args": [
      "/api/hello"
    ]
  },
  "level": "info",
  "message": "Hello from SWR",
  "vercel": {
    "environment": "production",
    "projectId": "prj_NHRfKvjJ98HnVZ1JQHocgGhqTLOZ",
    "region": "",
    "route": "",
    "source": "frontend-log",
    "userName": "islam-axiomco"
  }
}

@schehata
Copy link
Collaborator Author

verbal lambda-log:

{
  "fields": {
    "url": "/api/hello"
  },
  "level": "info",
  "message": "Hello from function",
  "request": {
    "host": "axiom-local-next-8avdvo8f0-islam-axiomco.vercel.app",
    "ip": "***",
    "method": "GET",
    "path": "/api/hello",
    "region": "iad1",
    "scheme": "https",
    "statusCode": 200,
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15"
  },
  "vercel": {
    "environment": "production",
    "projectId": "prj_NHRfKvjJ98HnVZ1JQHocgGhqTLOZ",
    "region": "iad1",
    "route": "/api/hello",
    "source": "lambda-log",
    "userName": "islam-axiomco"
  }
}

@schehata
Copy link
Collaborator Author

schehata commented Nov 30, 2022

verbal edge-log:

{
  "level": "warn",
  "message": "this is a log from edge function",
  "request": {
    "host": "axiom-local-next-8avdvo8f0-islam-axiomco.vercel.app",
    "ip": "***",
    "method": "GET",
    "path": "/api/edge-func",
    "region": "",
    "scheme": "https",
    "statusCode": 200,
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15"
  },
  "vercel": {
    "environment": "production",
    "projectId": "prj_NHRfKvjJ98HnVZ1JQHocgGhqTLOZ",
    "region": "",
    "route": "/api/edge-func",
    "source": "edge-log",
    "userName": "islam-axiomco"
  }
}

README.md Outdated Show resolved Hide resolved
Co-authored-by: Arne Bahlo <arne@axiom.co>
@schehata schehata merged commit 4d6f3a0 into main Dec 1, 2022
@schehata schehata deleted the netlify-deploy-env-vars branch December 1, 2022 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants