{"repo":"sangria-graphql/sangria-slowlog","free":true,"listed":false,"github":"https://github.com/sangria-graphql/sangria-slowlog","clone":"git clone https://github.com/sangria-graphql/sangria-slowlog.git","description":"Sangria middleware to log slow GraphQL queries (with OpenTracing and apollo-tracing extension)","language":"Scala","stars":47,"topics":["sangria","slowlog","graphql","metrics","performance"],"license":"Apache-2.0","category":"analytics","readme_excerpt":"sangria-slowlog - Sangria middleware to log slow queries. SBT Configuration: - last stable release: Usage With middleware, Sangria provides a very convenient way to instrument GraphQL query execution and introduce profiling logic. sangria-slowlog provides a simple mechanism to log slow queries and show profiling information. Library provides a middleware that logs instrumented query information if execution exceeds specific threshold. An example: If query execution takes more than 10 seconds to execute, then you will see similar info in the logs: sangria-slowlog has full support for GraphQL fragments and polymorphic types, so you will always see metrics for concrete types. In addition to logging, sangria-slowlog also supports graphql extensions. Extensions will add a profiling info in the response under extensions top-level field. In the most basic form, you can use it like this (this approach also disables the logging): After middleware is added, you will see following JSON in the response: All SlowLog methods accept addExtensions argument which allows you to include these extensions along the way. With a small tweaking, you can also include \"Profile\" button in GraphiQL. On the server you just need to conditionally include SlowLog.extension middleware to make it work. Here is an example of how this integration might look like. Apollo Tracing Extension sangria-slowlog also supports apollo-tracing format for metrics. In order to enable the extension, just use ApolloTracingExte","default_branch":null,"files":null,"tree":[],"storefront":"/r/sangria-graphql","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/sangria-graphql/sangria-slowlog/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}