Skip to content

Commit

Permalink
Merge pull request #11 from embrace-io/root-spans-updates
Browse files Browse the repository at this point in the history
updating  docs replacing traces with Root Spans
  • Loading branch information
gregorio-gerardi authored Oct 14, 2024
2 parents 65cfbc9 + 68ad992 commit bf07da5
Show file tree
Hide file tree
Showing 42 changed files with 215 additions and 192 deletions.
12 changes: 6 additions & 6 deletions docs/android/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@ Do not use these versions of the SDK. This issue has been addressed in 6.9.2.
*July 4, 2024*
- OpenTelemetry compatibility improvements:
- Provide implementation of the [OpenTelemetry Tracing API](https://opentelemetry.io/docs/specs/otel/trace/api/).
- Spans recorded through this API and implementation are equivalent to those recorded using the Embrace Performance Tracing API.
- Spans recorded through this API and implementation are equivalent to those recorded using the Embrace Traces API.
- This can be obtained through the `getOpenTelemetry()` method, which will return working implementations for methods involving tracing. Methods involving Logs and Metrics are no-ops at the current time.
- Stopping spans through the Embrace Performance Tracing API no longer implicitly sets Status to `OK`.
- Stopping spans through the Embrace Traces API no longer implicitly sets Status to `OK`.
- Add `telemetry.distro.*` resource attributes to exported signals.
- Update OpenTelemetry SDK dependency to version 1.38 of the [OpenTelemetry BOM](https://github.com/open-telemetry/opentelemetry-java?tab=readme-ov-file#bill-of-material).
- Consume semantic conventions from [OTel Semantic Conventions for Java](https://github.com/open-telemetry/semantic-conventions-java).
- Enhance Performance Tracing API to support behavior exposed via the OpenTelemetry Tracing API.
- Enhance Traces API to support behavior exposed via the OpenTelemetry Tracing API.
- Change internal endpoint to which session data is sent (no user-facing behavior changes).
- Issue build warning for apps that have minSdk < 24 and are using AGP < 8.3.
- If minSdk is lower than 24 (i.e. Android 5 and/or 6 is supported by the app), AGP version 8.3+ must be used so the app can be desugared with the proper setting.
Expand Down Expand Up @@ -141,8 +141,8 @@ API Desugaring is now a requirement for apps that support Android 5 and 6. This

## 6.4.0
*March 6, 2024*
- Performance Tracing improvements
- Support configuration of OpenTelemetry Exporters to export [Performance Tracing](/android/features/tracing/#export-to-opentelemetry-collectors) data as OpenTelemetry Spans (beta).
- Traces improvements
- Support configuration of OpenTelemetry Exporters to export [Traces](/android/features/traces/#export-your-telemetry) data as OpenTelemetry Spans (beta).
- Change timestamps parameters of the APIs to use milliseconds to better align with Android developer expectations.
- Note: timestamps that are in nanoseconds will be detected and converted for now so existing instrumentation will still work, but this will be removed in an upcoming release.
- Increase per-session limit of spans to 500 in total.
Expand Down Expand Up @@ -202,7 +202,7 @@ Gradle 8.4+ is not supported by this version when the NDK crash capture feature

## 6.1.0
*November 24, 2023*
- Enabled [Performance Tracing](/android/features/tracing/) by default
- Enabled [Traces](/android/features/traces/) by default
- Improved build performance of the Gradle plugin
- Improved session data delivery retries
- Enforce network call per session limits properly
Expand Down
2 changes: 1 addition & 1 deletion docs/android/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ This could be due to one of the following reasons:

### **How do I measure operations running in parallel?**

Please refer to [Performance Tracing feature guide](/android/features/tracing) for a reference on how to measure custom app operations using Embrace, including ones running in parallel.
Please refer to [Traces feature guide](/android/features/traces) for a reference on how to measure custom app operations using Embrace, including ones running in parallel.


## Tap Coordinates
Expand Down
2 changes: 1 addition & 1 deletion docs/android/features/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ sidebar_position: 2
Embrace's SDK includes many advanced features that you can enable to help you understand more about
how your application is performing in production.

* [**Performance Tracing.**](/android/features/tracing.md) Record traces to monitor the production performance and success rates of operations within your application.
* [**Traces.**](/android/features/traces.md) Record traces to monitor the production performance and success rates of operations within your application.
* [**Breadcrumbs.**](/android/features/breadcrumbs.md) Enrich your sessions with Breadcrumb, a lightweight way to add logging to your session.
* [**Know your users.**](/android/features/identify-users.md) Add your own custom identifiers to users and sessions to make sure you can aggregate and find sessions correctly.
* [**Session Properties.**](/android/features/session-properties.md) Session Properties provide a way to annotate the session with additional information.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
---
title: Performance Tracing
description: Record traces to monitor the production performance and success rates of operations within your mobile app.
title: Traces
description: Record span to monitor the production performance and success rates of operations within your mobile app.
sidebar_position: 2
---

# Performance Tracing
# Traces

## Overview

Embrace’s Performance Tracing solution gives you visibility into any app operation you’d like to track, including duration, success rate, and any contextual metadata collected at runtime that helps debug the root cause of your mobile app's performance issues. With our tool, you can quickly spot any bottlenecks in your app’s architecture, pinpoint areas you need to troubleshoot with high precision, and ultimately deliver a truly optimized user experience.
Embrace’s Traces solution gives you visibility into any app operation you’d like to track, including duration, success rate, and any contextual metadata collected at runtime that helps debug the root cause of your mobile app's performance issues. With our tool, you can quickly spot any bottlenecks in your app’s architecture, pinpoint areas you need to troubleshoot with high precision, and ultimately deliver a truly optimized user experience.

## Feature Support

:::info Minimum Requirements
**We recommend using the latest Android SDK version for the most up-to-date API**. Even though Performance Tracing is enabled in earlier versions as well, they only support a subset of features described in this doc, which applies to versions 6.4.0 and above.
**We recommend using the latest Android SDK version for the most up-to-date API**. Even though Traces is enabled in earlier versions as well, they only support a subset of features described in this doc, which applies to versions 6.4.0 and above.
:::

The Embrace Performance Tracing API allows you to:
The Embrace Traces API allows you to:

- Create real-time performance timers or record data for past operations.
- For real-time tracing, we use a “stopwatch” concept that lets you start and stop a span's recording manually.
Expand All @@ -29,7 +29,7 @@ The Embrace Performance Tracing API allows you to:

There are no limits on the duration of a span as long as the app is running.

There are also no limits to the number of child spans you can have per trace, provided the total number of spans do not exceed the per-session maximum.
There are also no limits to the number of child spans you can have per Root Span, provided the total number of spans does not exceed the per-session maximum.

### Limits

Expand Down Expand Up @@ -57,14 +57,14 @@ If you exceed the listed limits, the operation with the limit-exceeding call wil
The `emb-` and `emb.` prefixes are reserved for internal Embrace span and attribute names, respectively. You should never create a span or attribute key name with `emb-` and `emb.` prefixes
:::

## Adding Performance Traces To Your App
## Adding Traces To Your App

To use this feature:

1. Ensure you’re using a version of the Embrace SDK that supports Performance Tracing.
1. Ensure you’re using a version of the Embrace SDK that supports Traces.
2. (Optional) Enable API desugaring for your app if you want users running Android 5.x and 6.x to report traces.
3. Instrument your app using the reference guide in this section to start adding traces to your operations, or refer to the [API docs](https://embrace-io.github.io/embrace-android-sdk/) for a more comprehensive description of the public API.
4. See the traces in the Traces section of the Embrace dashboard.
3. Instrument your app using the reference guide in this section to start adding spans to your operations, or refer to the [API docs](https://embrace-io.github.io/embrace-android-sdk/) for a more comprehensive description of the public API.
4. See the spans in the Traces section of the Embrace dashboard.

## API Usage Examples

Expand All @@ -79,7 +79,6 @@ import TabItem from '@theme/TabItem';
<TabItem value="kotlin" label="Kotlin">

```kotlin
// create a trace by creating its root span
// recording will not begin until the span has been started
val activityLoad = Embrace.getInstance().createSpan("load-activity")
```
Expand All @@ -88,7 +87,6 @@ val activityLoad = Embrace.getInstance().createSpan("load-activity")
<TabItem value="java" label="Java">

```java
// create a trace by creating its root span
// recording will not begin until the span has been started
EmbraceSpan activityLoad = Embrace.getInstance().createSpan("load-activity");
```
Expand Down Expand Up @@ -127,11 +125,11 @@ EmbraceSpan activityLoad = Embrace.getInstance().startSpan("load-activity");

```kotlin
val appStartTimeMillis = getAppStartTime()
val appLaunchTrace = Embrace.getInstance().createSpan("app-launch")
val appLaunchSpan = Embrace.getInstance().createSpan("app-launch")

// begin recording a trace that has a different start time than
// begin recording a span that has a different start time than
// the current time by starting its root span with a specific timestamp
appLaunchTrace?.start(startTimeMs = appStartTimeMillis)
appLaunchSpan?.start(startTimeMs = appStartTimeMillis)
```

</TabItem>
Expand All @@ -141,7 +139,7 @@ appLaunchTrace?.start(startTimeMs = appStartTimeMillis)
long appStartTimeMillis = getAppStartTime();
EmbraceSpan activityLoad = Embrace.getInstance().createSpan("load-activity");

// begin recording a trace that has a different start time than
// begin recording a span that has a different start time than
// the current time by starting its root span with a specific timestamp
if (activityLoad != null) {
activityLoad.start(appStartTimeMillis);
Expand Down Expand Up @@ -295,7 +293,7 @@ if (activityLoad != null) {
</TabItem>
</Tabs>

### Record a Trace Before the Embrace SDK Has Started
### Record a Span Before the Embrace SDK Has Started

<Tabs groupId="android-language" queryString="android-language">
<TabItem value="kotlin" label="Kotlin">
Expand Down
72 changes: 0 additions & 72 deletions docs/features/performance-tracing.md

This file was deleted.

75 changes: 75 additions & 0 deletions docs/features/traces.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---
title: Traces
sidebar_position: 1
---

# Traces

Embrace’s Traces solution gives you visibility into any app operation you’d like to track, including duration, success rate, and any contextual metadata collected at runtime that helps debug the root cause of your mobile app's performance issues. With our tool, you can quickly spot any bottlenecks in your app’s architecture, pinpoint areas you need to troubleshoot with high precision, and ultimately deliver a truly optimized user experience.

## Root Spans View
The primary page shows all root spans in your app, as well as summary metrics like count, error rate, percentiles of duration, and changes from a previous version.

<img src={require('@site/static/images/traces-page.png').default} alt="Traces"/>

To narrow down the spans that are summarized in this view, you can apply the following filters on the root span as well as the child spans:
* Name
* Duration
* Outcome
* Attributes keys and values
* Span event names

## Root Span Summary View
By clicking on the name of a Root Span in the Root Spans View, you can see a partial listing of all the instances of that Root Span.

Each row represents a specific instance of that Root Span being recorded. You can see its status, unique Span ID, and duration, in addition to start and end times. All of these columns other than the Span ID is sortable.

Clicking on the instance will open up an in-line preview of the details of that instance, including the child spans that it has, their duration, and whether they were completed successfully.

On the right side each row that shows a Root Span instance, there are two icons. The first one takes you to the Root Span Instance View, where you can see all the details about that instance, including attributes and events on each child span. The second one takes you to the specific session in the User Timeline view that this instance ended in so you can see the full context of what happened before and after this Root Span was recorded.

<img src={require('@site/static/images/root-span-summary-1.png').default} alt="Root Span summary"/>

You can filter by properties similar to those in the Root Span View.

<img src={require('@site/static/images/root-spans-filters.png').default} alt="Trace summary filters"/>

## Root Span Instance View
This view shows a Root Span in its entirety. Not only can you see all the information in trace instance preview, you can also see at the individual events and attributes recorded as part of on a each child span, along with metadata about the device and app.

<img src={require('@site/static/images/root-span-instance-1.png').default} alt="Trace instance"/>

## User Timeline view
Root Spans appear in both the Timeline View and Timeline Details.

Clicking on "See Details" for any Root Span within the timeline will take you directly to the Root Span Instance View.

<img src={require('@site/static/images/traces-timeline.png').default} alt="User timeline"/>

## Sessions Filters
Not only can you filter spans in the various pages dedicated to Traces, you can filter sessions in the Sessions View by whether or not they contain specific spans with certain attributes and events.

<img src={require('@site/static/images/trace-session-filters.png').default} alt="Session filters"/>

## Boards, Alerts, and Custom Metrics
You can create Boards, Alerts, and Custom Metrics based on span data.

<img src={require('@site/static/images/spans-widgets.png').default} alt="Trace widgets"/>
<img src={require('@site/static/images/spans-alerts.png').default} alt="Trace alerts"/>

## Slow Root Spans
With the Slow Root Spans feature, you can identify performance bottlenecks and prioritize your optimization efforts.
Slow Root Spans are instances with both significant occurrences (100 over the last two days) and durations surpassing the 95th percentile of successful spans bearing the same name.
You can get the slow Root Spans on the issues page.

<img src={require('@site/static/images/slow-root-spans.png').default} alt="Slow traces"/>

Once you click on a Slow Root Span, you can see specific instances of that span.

## Implementation Details
1. [**Android**](/android/features/traces)
2. [**iOS**](/ios/open-source/traces)
3. [**Unity**](/unity/features/traces)
4. [**React Native**](/react-native/features/traces)
5. [**Flutter**](/flutter/features/traces)

Loading

0 comments on commit bf07da5

Please sign in to comment.