Skip to content

Conversation

waltjones
Copy link
Contributor

Description of the change

Refactor to trigger telemetry export from ReplayMap.

Type of change

  • Refactor

Checklists

Development

  • Lint rules pass locally
  • The code changed/added as part of this pull request has been covered with tests
  • All tests related to the changed code pass in development

@waltjones waltjones marked this pull request as draft September 9, 2025 17:52
@waltjones waltjones force-pushed the waltjones/telemetry-export-from-replaymap branch from f68ca86 to a672269 Compare September 10, 2025 14:13
@waltjones waltjones marked this pull request as ready for review September 10, 2025 14:21
Copy link
Contributor

@matux matux left a comment

Choose a reason for hiding this comment

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

Just one comment to understand what exporting a telemetry span means

Comment on lines +54 to +59
Telemeter.prototype.exportTelemetrySpan = function (attributes = {}) {
if (this.telemetrySpan) {
this.telemetrySpan.end(attributes);
this.telemetrySpan = this.tracing.startSpan('rollbar-telemetry', {});
}
};
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure I understand the intention, what is this function exporting and where to? Or is this just reseting/restarting the telemetry span? Or does ending the telemetrySpan moves data somewhere else?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

span.end() always causes an export. That's part of the standard tracing behavior.

This method ensures the currently open span is ended and exported so that it can be included in the next payload, and opens a new span to continue capturing telemetry events.

Copy link
Contributor

Choose a reason for hiding this comment

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

And no new span is gonna be opened if no current telemetry span exist.

@waltjones waltjones merged commit 527d6ae into master Sep 10, 2025
4 checks passed
@waltjones waltjones deleted the waltjones/telemetry-export-from-replaymap branch September 10, 2025 14:35
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