You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
We're coming from #1198 with a similar problem. When we apply the custom attributes of the returned errors they get added to the Prometheus metrics, but it's not possible to tell which subgraph threw the error.
The metric now contains the error code as configured, but from the attributes it's not possible to tell which subgraph nor operation caused this issue. That would be essential information to work with this metric.
As an additional plus: This was mentioned in the other issue as well. .errors[0].extensions.code only retrieves the first error, allowing the JSON path syntax .errors[*].extensions.code to get them all would be nice to have as well.
Describe the solution you'd like
It would be great to have the possibility to include the subgraph and operation name into this metric.
Describe alternatives you've considered
We also tried the following config:
But we later found out this config only works for subgraph errors that are not returning with HTTP status 200 or when the subgraph can't be reached. For client errors like BAD_USER_INPUT this would not be the case and this config therefore does not work.
The text was updated successfully, but these errors were encountered:
Hey @bnjjj, thanks for the quick answer.
Yes indeed that does what we were looking for. We didn't knew about this configuration option [from looking at the docs}(https://www.apollographql.com/docs/router/configuration/metrics#adding-custom-attributeslabels).
TLDR: when the http status code from subgraph != 200 you need to specify what do you want in error section, if it's a graphql error with an http status code == 200 then you need to specify configuration in response. There aren't exclusive at all you can configure both like in this example
Is your feature request related to a problem? Please describe.
We're coming from #1198 with a similar problem. When we apply the custom attributes of the returned errors they get added to the Prometheus metrics, but it's not possible to tell which subgraph threw the error.
Given configuration:
Will create the following Prometheus Metric:
The metric now contains the error code as configured, but from the attributes it's not possible to tell which subgraph nor operation caused this issue. That would be essential information to work with this metric.
As an additional plus: This was mentioned in the other issue as well.
.errors[0].extensions.code
only retrieves the first error, allowing the JSON path syntax.errors[*].extensions.code
to get them all would be nice to have as well.Describe the solution you'd like
It would be great to have the possibility to include the subgraph and operation name into this metric.
Describe alternatives you've considered
We also tried the following config:
But we later found out this config only works for subgraph errors that are not returning with HTTP status 200 or when the subgraph can't be reached. For client errors like
BAD_USER_INPUT
this would not be the case and this config therefore does not work.The text was updated successfully, but these errors were encountered: