Skip to content

Conversation

@beekhc
Copy link
Contributor

@beekhc beekhc commented Dec 14, 2025

This adds configuration options for MetricKit instrumentation, based on the existing URLSession instrumentation. I also added an overload so that this won't be a breaking change for any existing users.

The two initial configuration options are:

  • useAppleStacktraceFormat -- to force using Apple's format for JSON stacktraces instead of the new OTel one
  • tracer -- to allow using a custom tracer, the same as in the URLSession config

Tests were added for all new options.

@beekhc
Copy link
Contributor Author

beekhc commented Dec 15, 2025

The failed macOS test appears to be unrelated to my changes, and passes locally. Maybe it's just flaky?

beekhc added a commit to honeycombio/honeycomb-opentelemetry-swift that referenced this pull request Dec 17, 2025
…strumentation instead of Honeycomb versions (#125)

## Which problem is this PR solving?

Adds options to use upstream URLSession and MetricKit instrumentation.

## Short description of the changes

The URLSession instrumentation defaults to true (using the upstream
version), because the change should be invisible to our customers. I
only left the old instrumentation in there for now in case there is some
problem when customers upgrade, so they can switch back without waiting
for us to make a new release.

The MetricKit instrumentation defaults to false for now, because there
are minor differences between the upstream version and ours. I have [a
PR out](open-telemetry/opentelemetry-swift#1014)
to iron out those differences. Once they are identical, we can switch
this to default to true.

Next time there's a major release, we should remove these options and
remove our own versions of this instrumentation.

## How to verify that this has the expected result

Smoke tests still pass with the new defaults. I have also tried them
with the other values manually and verified they still work (with the
expected changes to MetricKit telemetry).

---

- [X] CHANGELOG is updated
- [X] README is updated with documentation
N/A ~- [ ] Update `honeycombLibraryVersion` in
`Sources/Honeycomb/HoneycombVersion.swift`~
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.

1 participant