-
Notifications
You must be signed in to change notification settings - Fork 3
feat: supporting advanced trace cases #645
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
06270a8
docs(observability-react-native): add distributed tracing guide
abelonogov-ld 894e208
docs(observability-react-native): add OTel baggage example to tracing…
abelonogov-ld 351b72d
docs(observability-react-native): add Tracing tab to example app
abelonogov-ld 1143993
chore(example): gitignore RN example iOS/Ruby lock files
abelonogov-ld 3fc0099
fix(observability-android): report service.name and service.version a…
abelonogov-ld c6217bb
Merge branch 'fix/android-service-name' (service.name resource attrib…
abelonogov-ld 9086597
chore(session-replay-rn): bump launchdarkly-android-client-sdk to 0.46.1
abelonogov-ld c907c45
RN work
abelonogov-ld 2598138
Merge branch 'chore/bump-android-client-sdk' into docs/rn-distributed…
abelonogov-ld d2376ab
adopting
abelonogov-ld 7407ddd
update Android dependencies
abelonogov-ld 9564d68
feat(observability-android): support external session id
abelonogov-ld 50d39bd
feat(observability-android): disable auto rotation for external sessi…
abelonogov-ld d61873c
chore(observability-android): drop unused activity instrumentation de…
abelonogov-ld ed34ca3
fix(observability-android): prime session manager with initial backgr…
abelonogov-ld b475547
LDObserve track
abelonogov-ld dc44a8e
Merge branch 'feat/android-external-session-id' into docs/rn-distribu…
abelonogov-ld 1a92ad8
utils
abelonogov-ld cf197e9
Merge branch 'main' into docs/rn-distributed-tracing
abelonogov-ld 898bd11
bump
abelonogov-ld 8fa2015
docs(observability-react-native): add withSpan manual tracing example…
abelonogov-ld ad0d4b3
style: apply prettier formatting to RN example and shared test
abelonogov-ld 3fa3851
docs(observability-react-native): make root-span recipe verify trace …
abelonogov-ld eebc347
Merge branch 'main' into docs/rn-distributed-tracing
abelonogov-ld a37d435
fix(example): keep nested-span demo parented across awaits via withSp…
abelonogov-ld e2fc3e2
docs(observability-react-native): sync tracing guide examples with th…
abelonogov-ld eef4346
docs(observability-react-native): inline demo URLs so tracing example…
abelonogov-ld 2bb3f5d
fix(observability-shared): anchor tracingOrigins host patterns to the…
abelonogov-ld 9d06f16
fix(observability-react-native): keep LD event key/value precedence o…
abelonogov-ld File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
733 changes: 733 additions & 0 deletions
733
sdk/@launchdarkly/observability-react-native/guides/tracing.md
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
sdk/@launchdarkly/observability-react-native/src/api/SpanScope.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| import { Context, Span as OtelSpan, SpanOptions } from '@opentelemetry/api' | ||
|
|
||
| /** | ||
| * Options accepted by {@link Observe.withSpan} and {@link SpanScope.child}. | ||
| * | ||
| * In addition to the standard OpenTelemetry {@link SpanOptions}, an explicit | ||
| * `parent` context can be supplied. This is the mechanism that makes spans | ||
| * nest correctly across `await`s in React Native, where the active context is | ||
| * tracked only synchronously (see the distributed tracing guide). | ||
| */ | ||
| export type WithSpanOptions = SpanOptions & { | ||
| /** | ||
| * The context to parent the new span under. When omitted the currently | ||
| * active context is used. {@link SpanScope.child} sets this automatically to | ||
| * the parent scope's context, so children nest correctly even after an | ||
| * `await`. | ||
| */ | ||
| parent?: Context | ||
| } | ||
|
|
||
| /** | ||
| * A handle to a span started with {@link Observe.withSpan}. | ||
| * | ||
| * A scope captures its own span context, so child spans created via | ||
| * {@link SpanScope.child} are parented correctly even across `await` | ||
| * boundaries — without manually threading context through your code. | ||
| */ | ||
| export interface SpanScope { | ||
| /** The underlying OpenTelemetry span. */ | ||
| readonly span: OtelSpan | ||
|
|
||
| /** | ||
| * This span's context. Pass it anywhere an explicit parent {@link Context} | ||
| * is required. | ||
| */ | ||
| readonly ctx: Context | ||
|
|
||
| /** | ||
| * Start a child span parented to *this* scope, run `fn`, and end the span | ||
| * automatically. The span's status is set to `OK` on success, or `ERROR` | ||
| * (with the thrown error recorded) if `fn` throws or rejects. | ||
| * | ||
| * Because the parent is captured from this scope rather than read from the | ||
| * active context, the child nests correctly even when created after an | ||
| * `await`. | ||
| * | ||
| * @param name The child span name | ||
| * @param fn The callback to run within the child scope | ||
| * @param options Optional span options | ||
| */ | ||
| child<T>( | ||
| name: string, | ||
| fn: (scope: SpanScope) => T, | ||
| options?: WithSpanOptions, | ||
| ): T | ||
|
|
||
| /** | ||
| * Run `fn` with *this* span active. Use this to parent auto-instrumented | ||
| * `fetch`/`XMLHttpRequest` spans that are started after an `await` (the | ||
| * point at which React Native loses the active context). Calls started in | ||
| * the synchronous portion of a {@link Observe.withSpan} callback are already | ||
| * parented automatically. | ||
| * | ||
| * @param fn The callback to run with this span active | ||
| */ | ||
| active<T>(fn: () => T): T | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| export * from './Options' | ||
| export * from './Metric' | ||
| export * from './RequestContext' | ||
| export type { SpanScope, WithSpanOptions } from './SpanScope' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.