admin管理员组文章数量:1355532
For general HTTP endpoints, we could usually calculate its availability by 2xx requests / total requests, or non-5xx-requests / total requests.
However GraphQL endpoints treat error as data and may include multiple data points in one single query. Is there a best practice to measure availability of that?
We are going to define a list of error codes which could be classified into 4xx-like and 5xx-like types. And if there is any 5xx-like error code in the error list of response, this request could be marked as a failure request. The availability could be calculated by non-failure requests / total requests. Does this make sense? Or any better idea?
For general HTTP endpoints, we could usually calculate its availability by 2xx requests / total requests, or non-5xx-requests / total requests.
However GraphQL endpoints treat error as data and may include multiple data points in one single query. Is there a best practice to measure availability of that?
We are going to define a list of error codes which could be classified into 4xx-like and 5xx-like types. And if there is any 5xx-like error code in the error list of response, this request could be marked as a failure request. The availability could be calculated by non-failure requests / total requests. Does this make sense? Or any better idea?
Share Improve this question asked Mar 28 at 14:15 predefined42predefined42 1 1- Please provide enough code so others can better understand or reproduce the problem. – Community Bot Commented Mar 29 at 14:40
1 Answer
Reset to default 0In this context GraphQL should be seen as a higher level protocol than HTTP. Standard HTTP mechanisms for evaluating availability still work, but may not provide the full picture, while still being valid. Still a non-2xx response code for HTTP is a valid indicator or error.
What you are asking is similar to trying to evaluate availability of HTTP just by relying on TCP metrics (lower level transport protocol).
There isn't a well established mechanism that is de-facto standardized. What makes it even tricky is that GraphQL can also work over other transports (WebSocket or MQTT).
If you are using a popular off the shelf GraphQL server likely it already has some metrics that it provides.
If you are using a custom implemented the following custom metrics could indicate issues:
Percentage of responses including errors
Average number of errors in responses (there may be more than one)
本文标签: How to measure availability of a GraphQL endpointStack Overflow
版权声明:本文标题:How to measure availability of a GraphQL endpoint? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744032083a2579096.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论