Skip to content

Conversation

ktoso
Copy link
Member

@ktoso ktoso commented Sep 11, 2025

This follows up #180 to get it over the finish line.

Main changes:

  • this is InMemoryTracer in the InMemoryTracing module
  • it does not crash in recording on an ended span
  • added "clear" and "pop spans" APIs
  • added documentation for everything

@slashmo please have a look, you can pick this into your PR if it looks good; I'd love to get this merged and released very soon, since we have PRs piling up in other repos waiting for this :)

@ktoso ktoso mentioned this pull request Sep 11, 2025
1 task

/// Retrives a specific _active_ span, identified by the specific span, trace, and parent ID's
/// stored in the `inMemorySpanContext`
public func activeSpan(identifiedBy context: ServiceContext) -> InMemorySpan? {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we move this up into to the other Tracer requirements like startSpan instead of this extension?

Copy link
Member Author

Choose a reason for hiding this comment

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

Well this is the // MARK: - InMemoryTracer querying so i think this is right here

Copy link
Collaborator

Choose a reason for hiding this comment

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

Okay, I thought you wanted to separate protocol conformance from additional InMemoryTracer-APIs here. If not I agree it thematically fits better here.

@ktoso ktoso marked this pull request as ready for review September 11, 2025 09:12
@ktoso ktoso added the 🆕 semver/minor Adds new public API. label Sep 11, 2025
@ktoso ktoso force-pushed the wip-inmemorytracer branch 2 times, most recently from f1caa85 to be1b852 Compare September 11, 2025 09:47
Copy link
Contributor

@czechboy0 czechboy0 left a comment

Choose a reason for hiding this comment

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

Looks great overall, just a few suggestions

@ktoso ktoso force-pushed the wip-inmemorytracer branch from be1b852 to 7dcf986 Compare September 11, 2025 10:16
@ktoso ktoso force-pushed the wip-inmemorytracer branch from adc1fd9 to e5f451c Compare September 11, 2025 11:20
@ktoso ktoso merged commit 6600888 into apple:main Sep 11, 2025
34 checks passed
@ktoso ktoso deleted the wip-inmemorytracer branch September 11, 2025 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🆕 semver/minor Adds new public API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants