VOOZH about

URL: https://thenewstack.io/spans-what-are-they-and-why-should-mobile-engineers-care/

⇱ Spans: What Are They and Why Should Mobile Engineers Care? - The New Stack


TNS
SUBSCRIBE
Join our community of software engineering leaders and aspirational developers. Always stay in-the-know by getting the most important news and exclusive content delivered fresh to your inbox to learn more about at-scale software development.
REQUIRED
It seems that you've previously unsubscribed from our newsletter in the past. Click the button below to open the re-subscribe form in a new tab. When you're done, simply close that tab and continue with this form to complete your subscription.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
Welcome and thank you for joining The New Stack community!
Please answer a few simple questions to help us deliver the news and resources you are interested in.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Great to meet you!
Tell us a bit about your job so we can cover the topics you find most relevant.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Welcome!

We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.

What’s next?

Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.

Follow TNS on your favorite social media networks.

Become a TNS follower on LinkedIn.

Check out the latest featured and trending stories while you wait for your first TNS newsletter.

PREV
1 of 2
NEXT
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Thanks for your opinion! Subscribe below to get the final results, published exclusively in our TNS Update newsletter:
NEW! Try Stackie AI
From clobbered drafts to real-time sync
Apr 14th 2026 10:00am, by David Moore
TypeScript 6.0 RC arrives as a bridge to a faster future
Mar 14th 2026 9:00am, by Darryl K. Taft
Mastra empowers web devs to build AI agents in TypeScript
Jan 28th 2026 11:00am, by Loraine Lawson
2024-08-22 07:58:17
Spans: What Are They and Why Should Mobile Engineers Care?
sponsor-embrace,sponsored-post-contributed,
Observability / Operations / Software Testing

Spans: What Are They and Why Should Mobile Engineers Care?

Spans measure the performance of key actions within your application, so you can quickly address issues like application hangs and slowness.
Aug 22nd, 2024 7:58am by Fredric Newberg
👁 Featued image for: Spans: What Are They and Why Should Mobile Engineers Care?
Source: Embrace
Embrace sponsored this post.

Mobile engineers are very familiar with application crashes and the importance of keeping crash rates within acceptable bounds. While not as drastic and obvious a failure as a crash, application hangs and slowness can have equally negative impacts on long-term user engagement.

People’s patience is finite, and most will tolerate slow, frustrating experiences for only so long before deleting an app, as this data shows.

So, what can you do to understand where your app is running slow?

This is where spans come in. They help you measure the performance of key actions within your application so you can quickly address problems.

What Is a Span?

Conceptually, spans are quite simple and consist of three key things:

  • They have a start time and end time, and thus measure a duration. This is different from crashes and error logs, which are anchored to a single point in time.
  • They have an outcome: Did what you were measuring succeed or fail?
  • They can have parent-child relationships with other spans.
👁 Example of a parent span and its child spans that measure the performance of add-to-cart functionality.

Example of a parent span and its child spans that measure the performance of add-to-cart functionality.

Spans are incredibly flexible in what they can be used for. Spans that monitor larger functions in the app, e.g., the entire time a user spends on a checkout page in an e-commerce app, are typically used by product organizations. However, I will discuss performance spans, which focus on more granular tasks and are typically more helpful to mobile engineers working to understand and fix performance issues.

A performance span measures the duration of actions and flows in your app that are not directly dependent on user interactions. In other words, performance spans measure how long it takes a given action to complete (e.g., add to cart).

What Are the Benefits of Using Spans?

Spans can help mobile engineers in several ways.

Understand Performance and Identify Slowness

Spans help you understand the true performance of your app once it has been released. Actions may be fast and never hang while testing a clean install of your app on a modern iOS or Android device with a fast network connection. But they may behave very differently for a significant subset of your real-world users.

Unless you instrument performance spans, you won’t know what your user population really experiences. Maybe average startup duration on some devices jumps significantly due to a new ad SDK version. Perhaps payment processing is slow for users in certain countries. Unless you measure these things, you will not know the frustration building with significant parts of your user population.

👁 Example of a span that shows a combination of acceptable and unacceptable durations. For about 65% of users, this span duration was fine, but for the remaining 35% the duration is unacceptably long.

Example of a span that shows a combination of acceptable and unacceptable durations. For about 65% of users, this span duration is fine, but for the remaining 35%, the duration is unacceptably long.

As a mobile engineer, it can be incredibly helpful to know the extent of a problem. Did your app get a few bad reviews for slow behavior but the issue doesn’t affect a large proportion of your users? Or do the negative reviews indicate a problem that affects a larger percentage of users?

Having span data makes it much simpler to decide whether to prioritize improving the performance of various parts of your app. In the sample chart above, a real problem exists for about 35% of users.

Use a Shared Language With Your DevOps Team

Your backend team already uses spans to understand service and infrastructure health, and your DevOps team is familiar with how to analyze and monitor them. Adopting a shared telemetry language allows you to standardize how you instrument the pieces of your mobile and web apps. Using a shared language also simplifies how you can connect the spans that start in the mobile app with all the backend services they interact with.

By tracing key actions and flows through the entire journey from client to backend and back to the client, you get a complete picture of what is really causing the slowness that end users experience.

What Parts of Your Mobile App Need Spans?

Spans are incredibly versatile, so how you can best use them for your application will depend on your business and technical goals. I will use an e-commerce app as an example for understanding what makes sense to instrument. In general, though, enumerating the parts or flows in your app that are most critical to a good user experience is a good starting point for deciding where to add spans.

Critical flows in most e-commerce apps include:

Login

While some apps allow purchasing as a guest, in most cases buyers have to log in. While this may seem like a simple process, modern logins have many components that were not common a decade ago, such as biometric inputs and two-factor authentication (2FA). You can have a root span for the login and child spans for the individual components, such as accessing biometric data and getting input for 2FA.

Product Search

How long does it take for search results to appear? How well does delivering search results work over challenging network connections? How long does it take to render the search results? You can use a root span for the search operation and break it down.

Adding an Item to the Shopping Cart

When a user clicks a button to add an item to their cart, how long does it take to succeed? Are there network calls? Will it work with a poor network connection?

Checkout

The most important part of an e-commerce app is enabling users to successfully make purchases, so monitoring the actual order submission process is incredibly important. You can add a span that measures the time from when a “Submit order” button is clicked until the “Order confirmed screen” appears. Then you can add child spans that measure individual steps in that journey, like making a call to a third-party payment provider.

How You Can Get Started Adding Spans to Your Mobile App

Instrumenting a few spans manually is typically not a challenging task, and when you use an observability SDK like the ones we have built at Embrace, you will also get auto-instrumented spans for common tasks such as network requests. You can start by instrumenting one or two critical flows in your app and then expand from there. You don’t need to exhaustively instrument every single flow in your app before you can derive value.

Choosing observability SDKs that are OpenTelemetry (OTel)-compliant gives you a great deal of flexibility in how you collect and analyze your performance span data. Embrace provides a hosted service, but you can also choose to send your data to an OTel-compatible collector.

To learn more about how performance spans can help you deliver a better end-user experience, feel free to check out Embrace’s website or join our Slack community.

Embrace is the user-focused observability platform that ties technical performance to end-user impact. Powered by OpenTelemetry, Embrace provides real user monitoring for mobile and web, so engineering teams can resolve issues faster, improve performance, and deliver exceptional digital experiences.
Learn More
The latest from Embrace
TRENDING STORIES
Fredric is Co-Founder and CTO at Embrace where he has led the company’s innovation in mobile app observability technology for customers like The New York Times, Marriott, Yahoo! and more. Previously, he built backend systems to handle the high data...
Read more from Fredric Newberg
Embrace sponsored this post.
SHARE THIS STORY
TRENDING STORIES
SHARE THIS STORY
TRENDING STORIES
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.