dotellie / apollo-metrics Goto Github PK
View Code? Open in Web Editor NEWExport Apollo server request information to Prometheus through prom-client
License: MIT License
Export Apollo server request information to Prometheus through prom-client
License: MIT License
Building with apollo-metrics
1.0.1 against a project using apollo-server-plugin-base 0.7.1 results in a TypeScript compile error due to the changes in didEncounterErrors
requestContext
:
[ERROR] TSError: ⨯ Unable to compile TypeScript:
[ERROR] src/server/server.ts(124,9): error TS2322: Type 'ApolloServerPlugin<Record<string, any>>' is not assignable to type 'PluginDefinition'.
[ERROR] Type 'import("/build/graphql/node_modules/apollo-server-plugin-base/dist/index").ApolloServerPlugin<Record<string, any>>' is not assignable to type 'import("/build/graphql/node_modules/apollo-server-core/node_modules/apollo-server-plugin-base/dist/index").ApolloServerPlugin<Record<string, any>>'.
[ERROR] The types returned by 'requestDidStart(...)' are incompatible between these types.
[ERROR] Type 'void | import("/build/graphql/node_modules/apollo-server-plugin-base/dist/index").GraphQLRequestListener<Record<string, any>>' is not assignable to type 'void | import("/build/graphql/node_modules/apollo-server-core/node_modules/apollo-server-plugin-base/dist/index").GraphQLRequestListener<Record<string, any>>'.
[ERROR] Type 'GraphQLRequestListener<Record<string, any>>' is not assignable to type 'void | GraphQLRequestListener<Record<string, any>>'.
[ERROR] Type 'import("/build/graphql/node_modules/apollo-server-plugin-base/dist/index").GraphQLRequestListener<Record<string, any>>' is not assignable to type 'import("/build/graphql/node_modules/apollo-server-core/node_modules/apollo-server-plugin-base/dist/index").GraphQLRequestListener<Record<string, any>>'.
[ERROR] Types of property 'didEncounterErrors' are incompatible.
[ERROR] Type '(requestContext: WithRequired<GraphQLRequestContext<Record<string, any>>, "source" | "metrics" | "errors">) => ValueOrPromise<void>' is not assignable to type '(requestContext: WithRequired<GraphQLRequestContext<Record<string, any>>, "metrics" | "errors">) => ValueOrPromise<void>'.
[ERROR] Types of parameters 'requestContext' and 'requestContext' are incompatible.
[ERROR] Type 'WithRequired<GraphQLRequestContext<Record<string, any>>, "metrics" | "errors">' is not assignable to type 'WithRequired<GraphQLRequestContext<Record<string, any>>, "source" | "metrics" | "errors">'.
[ERROR] Type 'WithRequired<GraphQLRequestContext<Record<string, any>>, "metrics" | "errors">' is not assignable to type 'Required<Pick<GraphQLRequestContext<Record<string, any>>, "source" | "metrics" | "errors">>'.
[ERROR] Property 'source' is optional in type 'GraphQLRequestContext<Record<string, any>> & Required<Pick<GraphQLRequestContext<Record<string, any>>, "metrics" | "errors">>' but required in type 'Required<Pick<GraphQLRequestContext<Record<string, any>>, "source" | "metrics" | "errors">>'.
Seems to build fine when forcing the transitive dependency to the newer version:
"resolutions": {
"apollo-metrics/apollo-server-plugin-base": "^0.7.1",
"apollo-metrics/apollo-tracing": "^0.9.1"
},
Is there a grafana dashboard fit for this metrics?
I'm having issues with metrics when I run the Apollo Gateway.
Not sure how to debug TBH
I'd like to set up monitoring based on the apollo server query errors metric. At the same time I wouldn't want to alert on bad user input errors, or authentication errors (AuthenticationError
).
It would be helpful if the graphql_queries_errored
included an extra field, e.g. error_class
which would discern the kind of error and would help setting up useful alerting. Like HTTP 4xx vs 5xx codes.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.