Update ttfmp documentation to include the recent enhancements (#213416)

## Summary

Update docs for ttfmp
This commit is contained in:
Katerina 2025-05-28 17:11:37 +03:00 committed by GitHub
parent 6ab62defe3
commit b2a5badc53
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -405,6 +405,38 @@ An event using custom metrics will be indexed with the following structure:
}
```
#### Add inline documentation
The description metadata field is allowing teams to document how a page is instrumentented
```typescript
...
onPageReady({
meta: {
rangeFrom,
rangeTo,
description: '[ttfmp_dependencies] Dependencies table is ready after fetching top_dependencies.'
}
});
...
```
#### Track TTFMP on refresh load
TTFMP supports a new dimension: isInitialLoad, distinguishing between an initial page load and a refresh triggered by actions like the time picker.
This requires instrumenting `onPageRefreshStart()` when refreshing the page.
```typescript
...
const { onPageRefreshStart } = usePerformanceContext();
const handleRefresh = () => {
onPageRefreshStart()
}
...
```
### Development environment
The metric will be delivered to the [Telemetry Staging](https://telemetry-v2-staging.elastic.dev/) cluster, alongside with the event's context.