GraphQL Observability

Rate this content

GraphQL is an immensely powerful tool and while there are tons of resources out there on how to leverage it, there doesn't seem to be much open discussion around Day 2 (maintenance in production) operations of GraphQL. In this talk, we'll be focusing around observability and the various techniques and tools we can use to get a better understanding of how our graphQL services are running in production. More specifically we'll be focusing on combining ApolloServer and OpenTelemetry.

8 min
02 Jul, 2021

Video Summary and Transcription

This Talk discusses how to tool Apollo server with open tracing for observability. OpenTracing is a vendor-agnostic format that works well with distributed systems in microservices. It allows for converting GraphQL tracing data to a vendor-agnostic format and enriching information from GraphQL servers. If providers support OpenTracing, it can be easily integrated.

Available in Español

1. Introduction to Apollo Studio and Observability

Short description:

My name is Ashley Narcisse. I'm an engineer at Apollo GraphQL. We're going to dive into how to tool our Apollo server with open tracing. Observability boils down to really getting all the right data at the right level of abstractions to get the right context as a request that occurs to your system propagates throughout your entire infrastructure.

Oh, hey guys. How's everyone doing? Thank you for being here. My name is Ashley Narcisse. I'm an engineer at Apollo GraphQL. And I work with an awesome team of individuals that are building tools to help you developers make data more accessible.

Now speaking of information accessibility, I have a question for you. Have you ever wondered what's really happening in production, especially for your GraphQL services? I don't know about you, but I certainly have. It's something that I couldn't shake for a long time, the fact that GraphQL oftentimes felt like a black box. At least until I discovered a lot of the toolings that are in Apollo Studio. And that really, really, really helped me start to paint a better picture of all the different aspects of your graph.

Now there are a lot of features in Apollo Studios that I won't go within. But there's one feature that I will go into. So I'm like, mm. GraphQL comes with a tracing spec that, by this little nifty configuration right here, you can ship that information over into Apollo Studio. Now this was really the starting point of saying, wow, all right, cool. I'm starting to understand what's happening. I no longer have this black box imagination that it just works and can't really paint a picture as to the sheer breadth of different operations and the concentrations of what data my clients are requesting. We're going to dive into how to tool our Apollo server with open tracing. You're not just going to skip over the observability part, right? I know you. I mean, I feel like they can Google the definition for it. Nah, man, they can't just Google that. Yeah, you're right. Don't worry, I got it. Observability is a term borrowed from mechanical engineer or control theory, and it pretty much boils down to can you understand what's happening inside your system or any particular state that it can arrive to. A lot of APMs out there describe observability as having three pillars, logs, metrics, and tracing. And while the first two do fall kind of the category of things that you can predict, you can describe them as known, unknowns, right? Things that you know can potentially go wrong. But tracing is getting a bit closer. Observability boils down to really getting all the right data at the right level of abstractions to get the right context as a request that occurs to your system propagates throughout your entire infrastructure. Observability can really be boiled down to understanding the unknown unknowns. I appreciate you, you know that? My dog.

2. Introduction to OpenTracing

Short description:

OpenTracing is a spec that provides a vendor-agnostic format for creating tracing data. It works well with distributed systems in microservices, which aligns with GraphQL's abstraction capabilities. By going beyond the GraphQL tracing spec, we can convert to a vendor-agnostic format and enrich the information published from our GraphQL servers. If your providers support OpenTracing, it's plug and play.

Now, OpenTracing is a spec published by the Cloud Native Computing Foundation, which is a way to help provide a vendor-agnostic format of creating this tracing data. Now, it works really, really, what? Really, ahh! Really, really. It works really, really well with distributed systems in microservices, which is one of the things that GraphQL also does a really, really good job of helping abstract for our end clients. This is perfect, and here's why. We're able to go beyond the GraphQL tracing spec and convert over to a vendor-agnostic format while also enriching the information that is being published from our GraphQL servers, and if you have any providers that already supports OpenTracing, it's plug and play.

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

GraphQL Galaxy 2021GraphQL Galaxy 2021
32 min
From GraphQL Zero to GraphQL Hero with RedwoodJS
Top Content
We all love GraphQL, but it can be daunting to get a server up and running and keep your code organized, maintainable, and testable over the long term. No more! Come watch as I go from an empty directory to a fully fledged GraphQL API in minutes flat. Plus, see how easy it is to use and create directives to clean up your code even more. You're gonna love GraphQL even more once you make things Redwood Easy!
Vue.js London Live 2021Vue.js London Live 2021
24 min
Local State and Server Cache: Finding a Balance
Top Content
How many times did you implement the same flow in your application: check, if data is already fetched from the server, if yes - render the data, if not - fetch this data and then render it? I think I've done it more than ten times myself and I've seen the question about this flow more than fifty times. Unfortunately, our go-to state management library, Vuex, doesn't provide any solution for this.For GraphQL-based application, there was an alternative to use Apollo client that provided tools for working with the cache. But what if you use REST? Luckily, now we have a Vue alternative to a react-query library that provides a nice solution for working with server cache. In this talk, I will explain the distinction between local application state and local server cache and do some live coding to show how to work with the latter.
GraphQL Galaxy 2022GraphQL Galaxy 2022
16 min
Step aside resolvers: a new approach to GraphQL execution
Though GraphQL is declarative, resolvers operate field-by-field, layer-by-layer, often resulting in unnecessary work for your business logic even when using techniques such as DataLoader. In this talk, Benjie will introduce his vision for a new general-purpose GraphQL execution strategy whose holistic approach could lead to significant efficiency and scalability gains for all GraphQL APIs.

Workshops on related topic

GraphQL Galaxy 2021GraphQL Galaxy 2021
140 min
Build with SvelteKit and GraphQL
Top Content
Featured WorkshopFree
Have you ever thought about building something that doesn't require a lot of boilerplate with a tiny bundle size? In this workshop, Scott Spence will go from hello world to covering routing and using endpoints in SvelteKit. You'll set up a backend GraphQL API then use GraphQL queries with SvelteKit to display the GraphQL API data. You'll build a fast secure project that uses SvelteKit's features, then deploy it as a fully static site. This course is for the Svelte curious who haven't had extensive experience with SvelteKit and want a deeper understanding of how to use it in practical applications.

Table of contents:
- Kick-off and Svelte introduction
- Initialise frontend project
- Tour of the SvelteKit skeleton project
- Configure backend project
- Query Data with GraphQL
- Fetching data to the frontend with GraphQL
- Styling
- Svelte directives
- Routing in SvelteKit
- Endpoints in SvelteKit
- Deploying to Netlify
- Navigation
- Mutations in GraphCMS
- Sending GraphQL Mutations via SvelteKit
- Q&A
React Advanced Conference 2022React Advanced Conference 2022
95 min
End-To-End Type Safety with React, GraphQL & Prisma
Featured WorkshopFree
In this workshop, you will get a first-hand look at what end-to-end type safety is and why it is important. To accomplish this, you’ll be building a GraphQL API using modern, relevant tools which will be consumed by a React client.
Prerequisites: - Node.js installed on your machine (12.2.X / 14.X)- It is recommended (but not required) to use VS Code for the practical tasks- An IDE installed (VSCode recommended)- (Good to have)*A basic understanding of Node.js, React, and TypeScript
GraphQL Galaxy 2022GraphQL Galaxy 2022
112 min
GraphQL for React Developers
Featured Workshop
There are many advantages to using GraphQL as a datasource for frontend development, compared to REST APIs. We developers in example need to write a lot of imperative code to retrieve data to display in our applications and handle state. With GraphQL you cannot only decrease the amount of code needed around data fetching and state-management you'll also get increased flexibility, better performance and most of all an improved developer experience. In this workshop you'll learn how GraphQL can improve your work as a frontend developer and how to handle GraphQL in your frontend React application.
React Summit 2022React Summit 2022
173 min
Build a Headless WordPress App with Next.js and WPGraphQL
Top Content
In this workshop, you’ll learn how to build a Next.js app that uses Apollo Client to fetch data from a headless WordPress backend and use it to render the pages of your app. You’ll learn when you should consider a headless WordPress architecture, how to turn a WordPress backend into a GraphQL server, how to compose queries using the GraphiQL IDE, how to colocate GraphQL fragments with your components, and more.
GraphQL Galaxy 2020GraphQL Galaxy 2020
106 min
Relational Database Modeling for GraphQL
Top Content
In this workshop we'll dig deeper into data modeling. We'll start with a discussion about various database types and how they map to GraphQL. Once that groundwork is laid out, the focus will shift to specific types of databases and how to build data models that work best for GraphQL within various scenarios.
Table of contentsPart 1 - Hour 1      a. Relational Database Data Modeling      b. Comparing Relational and NoSQL Databases      c. GraphQL with the Database in mindPart 2 - Hour 2      a. Designing Relational Data Models      b. Relationship, Building MultijoinsTables      c. GraphQL & Relational Data Modeling Query Complexities
Prerequisites      a. Data modeling tool. The trainer will be using dbdiagram      b. Postgres, albeit no need to install this locally, as I'll be using a Postgres Dicker image, from Docker Hub for all examples      c. Hasura
GraphQL Galaxy 2021GraphQL Galaxy 2021
48 min
Building GraphQL APIs on top of Ethereum with The Graph
The Graph is an indexing protocol for querying networks like Ethereum, IPFS, and other blockchains. Anyone can build and publish open APIs, called subgraphs, making data easily accessible.

In this workshop you’ll learn how to build a subgraph that indexes NFT blockchain data from the Foundation smart contract. We’ll deploy the API, and learn how to perform queries to retrieve data using various types of data access patterns, implementing filters and sorting.

By the end of the workshop, you should understand how to build and deploy performant APIs to The Graph to index data from any smart contract deployed to Ethereum.