GraphQL Observability

Rate this content
Bookmark

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.

This talk has been presented at GraphQL Galaxy 2020, check out the latest edition of this Tech Conference.

FAQ

Ashley Narcisse is an engineer at Apollo GraphQL, working with a team to build tools that make data more accessible for developers.

Apollo Studio is a tool from Apollo GraphQL that provides features to help developers understand and manage their GraphQL services by providing insights into production operations.

Tracing in GraphQL, especially with the tracing spec, helps developers track and understand the operations and data requests within their GraphQL services, making the system's internal processes more transparent.

Observability is the ability to understand what is happening inside a system or any state it can reach, typically using three pillars: logs, metrics, and tracing. It focuses on gaining insights into the unknown aspects of system operations.

OpenTracing is a vendor-agnostic specification published by the Cloud Native Computing Foundation designed to create a standard for tracing data that works well with distributed systems and microservices.

OpenTracing integrates with Apollo Server by initializing an instance of a Jaeger client and using the Apollo OpenTracing package to configure tracing data, which is then added to the server's plugins array for detailed insight into operations.

Using OpenTracing with GraphQL allows developers to go beyond the GraphQL tracing specification, converting to a vendor-agnostic format and enriching the information published from GraphQL servers for better system observability.

Developers can access demonstrations and further details from Ashley Narcisse's talk by visiting the provided URL shared during the presentation or by reaching out to Ashley on Twitter.

Ashley Narcisse
Ashley Narcisse
8 min
02 Jul, 2021

Comments

Sign in or register to post your comment.

Video Summary and Transcription

This video dives into how to enhance Apollo Server's observability using OpenTracing. Observability in systems focuses on getting the right data at the right level of abstraction to understand requests as they propagate through the infrastructure. OpenTracing provides a vendor-agnostic format for creating tracing data, making it ideal for distributed systems and microservices. Integrating OpenTracing with Apollo Server involves initializing a Jaeger client and configuring the Apollo OpenTracing package for detailed insights. This approach goes beyond the GraphQL tracing spec, enriching the information from GraphQL servers. Apollo Studio is also highlighted as a tool for managing GraphQL services, offering insights into production operations. The video emphasizes the importance of tracing in GraphQL to make internal processes transparent. For more information, viewers can visit the provided URL or reach out on Twitter.
Available in Español: Observabilidad en GraphQL

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

From GraphQL Zero to GraphQL Hero with RedwoodJS
GraphQL Galaxy 2021GraphQL Galaxy 2021
32 min
From GraphQL Zero to GraphQL Hero with RedwoodJS
Top Content
Tom Pressenwurter introduces Redwood.js, a full stack app framework for building GraphQL APIs easily and maintainably. He demonstrates a Redwood.js application with a React-based front end and a Node.js API. Redwood.js offers a simplified folder structure and schema for organizing the application. It provides easy data manipulation and CRUD operations through GraphQL functions. Redwood.js allows for easy implementation of new queries and directives, including authentication and limiting access to data. It is a stable and production-ready framework that integrates well with other front-end technologies.
Local State and Server Cache: Finding a Balance
Vue.js London Live 2021Vue.js London Live 2021
24 min
Local State and Server Cache: Finding a Balance
Top Content
This Talk discusses handling local state in software development, particularly when dealing with asynchronous behavior and API requests. It explores the challenges of managing global state and the need for actions when handling server data. The Talk also highlights the issue of fetching data not in Vuex and the challenges of keeping data up-to-date in Vuex. It mentions alternative tools like Apollo Client and React Query for handling local state. The Talk concludes with a discussion on GitLab going public and the celebration that followed.
Batteries Included Reimagined - The Revival of GraphQL Yoga
GraphQL Galaxy 2021GraphQL Galaxy 2021
33 min
Batteries Included Reimagined - The Revival of GraphQL Yoga
Envelope is a powerful GraphQL plugin system that simplifies server development and allows for powerful plugin integration. It provides conformity for large corporations with multiple GraphQL servers and can be used with various frameworks. Envelope acts as the Babel of GraphQL, allowing the use of non-spec features. The Guild offers GraphQL Hive, a service similar to Apollo Studio, and encourages collaboration with other frameworks and languages.
Rock Solid React and GraphQL Apps for People in a Hurry
GraphQL Galaxy 2022GraphQL Galaxy 2022
29 min
Rock Solid React and GraphQL Apps for People in a Hurry
The Talk discusses the challenges and advancements in using GraphQL and React together. It introduces RedwoodJS, a framework that simplifies frontend-backend integration and provides features like code generation, scaffolding, and authentication. The Talk demonstrates how to set up a Redwood project, generate layouts and models, and perform CRUD operations. Redwood automates many GraphQL parts and provides an easy way for developers to get started with GraphQL. It also highlights the benefits of Redwood and suggests checking out RedwoodJS.com for more information.
Adopting GraphQL in an Enterprise
GraphQL Galaxy 2021GraphQL Galaxy 2021
32 min
Adopting GraphQL in an Enterprise
Today's Talk is about adopting GraphQL in an enterprise. It discusses the challenges of using REST APIs and the benefits of GraphQL. The Talk explores different approaches to adopting GraphQL, including coexistence with REST APIs. It emphasizes the power of GraphQL and provides tips for successful adoption. Overall, the Talk highlights the advantages of GraphQL in terms of efficiency, collaboration, and control over APIs.
Step aside resolvers: a new approach to GraphQL execution
GraphQL Galaxy 2022GraphQL Galaxy 2022
16 min
Step aside resolvers: a new approach to GraphQL execution
GraphQL has made a huge impact in the way we build client applications, websites, and mobile apps. Despite the dominance of resolvers, the GraphQL specification does not mandate their use. Introducing Graphast, a new project that compiles GraphQL operations into execution and output plans, providing advanced optimizations. In GraphFast, instead of resolvers, we have plan resolvers that deal with future data. Graphfast plan resolvers are short and efficient, supporting all features of modern GraphQL.

Workshops on related topic

Build with SvelteKit and GraphQL
GraphQL Galaxy 2021GraphQL Galaxy 2021
140 min
Build with SvelteKit and GraphQL
Top Content
Featured WorkshopFree
Scott Spence
Scott Spence
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
Build Modern Applications Using GraphQL and Javascript
Node Congress 2024Node Congress 2024
152 min
Build Modern Applications Using GraphQL and Javascript
Featured Workshop
Emanuel Scirlet
Miguel Henriques
2 authors
Come and learn how you can supercharge your modern and secure applications using GraphQL and Javascript. In this workshop we will build a GraphQL API and we will demonstrate the benefits of the query language for APIs and what use cases that are fit for it. Basic Javascript knowledge required.
End-To-End Type Safety with React, GraphQL & Prisma
React Advanced Conference 2022React Advanced Conference 2022
95 min
End-To-End Type Safety with React, GraphQL & Prisma
Featured WorkshopFree
Sabin Adams
Sabin Adams
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 for React Developers
GraphQL Galaxy 2022GraphQL Galaxy 2022
112 min
GraphQL for React Developers
Featured Workshop
Roy Derks
Roy Derks
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.
Build a Headless WordPress App with Next.js and WPGraphQL
React Summit 2022React Summit 2022
173 min
Build a Headless WordPress App with Next.js and WPGraphQL
Top Content
WorkshopFree
Kellen Mace
Kellen Mace
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.
Relational Database Modeling for GraphQL
GraphQL Galaxy 2020GraphQL Galaxy 2020
106 min
Relational Database Modeling for GraphQL
Top Content
WorkshopFree
Adron Hall
Adron Hall
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