How is netlify request calculated for API server usage?

I’m completely blown away by the fact that I can host a graphql server on netlify

Few Questions after staring at the docs:

  • How does functions usage and billing work exactly? I’m currently hosting a graphql server using netlify function. So in my case, how does a single request being calculated? Is it through per single API call(gql query) that the user makes? Would it help to reduce the number of request i were to use a redis server?

  • For run time, if no one is accessing the website, is the run time not counted?

  • How do I track where my users are from and how are they using my API server? I am curious why am I getting some traffic spike etc. Just want to make sure I’m not getting DDOS-ed

  • How do i look at the logs of my GraphQl server from netlify? Debugging?

For your first two bullet points, our functions docs mention it. For your third point, you could log your the event object (or parts of it) which might have some information that you can use to check. For logs, you can go to your site’s Function page and anything you console.log in your function will show up there.

Hope that helps!