Coder Social home page Coder Social logo

apollo-metrics's People

Contributors

artemsre avatar dependabot[bot] avatar dotellie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

apollo-metrics's Issues

Incompatible with apollo-server-plugin-base 0.7.1

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">>'.

Workaround

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"
  },

Federation

I'm having issues with metrics when I run the Apollo Gateway.

Not sure how to debug TBH

`graphql_queries_errored` to split the metrics by error type/class

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.