Skip to content

Integrating TelemetryStore with rest of sdk - #10308

Open
ssakhamu wants to merge 1 commit into
crashlytics-traces2from
telemetry-store-integration
Open

Integrating TelemetryStore with rest of sdk#10308
ssakhamu wants to merge 1 commit into
crashlytics-traces2from
telemetry-store-integration

Conversation

@ssakhamu

Copy link
Copy Markdown

integrates TelemetryStore with rest of crashlytics sdk and modifies on error log/span processor tests

@ssakhamu
ssakhamu requested a review from a team as a code owner August 14, 2026 19:40
@changeset-bot

changeset-bot Bot commented Aug 14, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 32fef3b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a centralized TelemetryStore to manage telemetry buffering for both logs and spans, replacing the separate internal buffers in OnErrorLogRecordProcessor and OnErrorSpanProcessor. In packages/crashlytics/src/api.ts, telemetryStore.clear() is called directly after destructuring from crashlytics. Since recordError is a public API, telemetryStore might not be defined on the passed object, which could lead to a runtime TypeError. It is recommended to use optional chaining (telemetryStore?.clear()) to safely clear the store.

Comment thread packages/crashlytics/src/api.ts
Comment thread packages/crashlytics/src/tracing/on-error-span-processor.ts
attributesStore: new AttributesStore({ projectId: 'fake-project' })
attributesStore: new AttributesStore({ projectId: 'fake-project' }),
telemetryStore: {
clear: stub()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is clear the only stub we need? Will this not call onStart and onEnd?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clear() is the only function being called as a result of recordError being triggered by the tests. The other calls are dependent on onErrorSpanProcessor and onErrorLogRecordProcessor, which are ignored in these tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants