-
Couldn't load subscription status.
- Fork 0
feat: instrumentation, client, sdk, crash report, network #5
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
Conversation
mario-launchdarkly
commented
Aug 22, 2025
- Added Instrumentation manager
- Added Session manager
- Refactor of observability manager
- Refactor of observe interface
- Configuration renamed to Options
- Some attributed of Options objects were renamed
- Added Crash reporter through KSCrash
- Added Network instrumentation
df8fd2d to
e149985
Compare
e149985 to
2255e48
Compare
Sources/API/Options.swift
Outdated
|
|
||
| public init( | ||
| serviceName: String = Self.defaultResource.attributes["service.name"]?.description ?? "observability-swift", | ||
| serviceVersion: String = Self.defaultResource.attributes["service.version"]?.description ?? "1.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Version should not be hardcoded. Add TODO and create story if you won't fix it in this PR, and also consider updating to 0.1.0 (or similar alpha version) regardless.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the default value only used if consumer app is not defining the version and the Instrumentation resource extension library is not able to get the app version.
e.g.
if is consumer providing a service version ?
then, use consumer's provided service version
else if resource extension library is able to get the consumer app version number
then, use the app version extracted from the consumer app (this is a otel helper library)
else
use the hardcoded value, since consumer did not provide service version nor otel library was able to provide a service version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way to get the build version? Here is the similar code in Android: https://github.com/launchdarkly/observability-sdk/blob/main/sdk/%40launchdarkly/observability-android/lib/src/main/kotlin/com/launchdarkly/observability/api/Options.kt#L33
| let tracer: Tracer | ||
| if let otelTracer { | ||
| tracer = otelTracer | ||
| } else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does getting into this else indicate that startSpan was called before init? Will the tracer gotten in this case behave correctly with respect to export and sampling? It seems like there must be some tradeoff otherwise all tracer/logger/meter providers could be lazy implementations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is because in Swift, when you initialize a URL with an string like "https://otel.observability.app.launchdarkly.com:4318/v1/traces", the resulting object is Optional, this because the string could be a non valid url, hence the url cannot be represented by an URL object, we are not expecting this, so, should not be the case, because https://otel.observability.app.launchdarkly.com:4318/v1/traces is a valid url, but on the other hand, we cannot force unwrap the optional because is not recommended, it will crash the app if by any reason the url is null.
@tanderson-ld let me know if you want to discuss this
🤖 I have created a release *beep* *boop* --- ## [0.4.0](swift-launchdarkly-observability-v0.3.0...swift-launchdarkly-observability-v0.4.0) (2025-10-23) ### Features * Add GraphQL Client ([5e52365](5e52365)) * add gzip compression ([d2133a7](d2133a7)) * Add LightWeight GraphQL Client ([ed9f6b5](ed9f6b5)) * Add LightWeight GraphQL Client ([#12](#12)) ([ed9f6b5](ed9f6b5)) * add standard output logger for debug ([#16](#16)) ([435f4cb](435f4cb)) * add tap handler, send span ([#7](#7)) ([96cf5ef](96cf5ef)) * add timeout for custom crash filter as param (10s default) ([daaa111](daaa111)) * instrumentation and session managers ([b6f1c05](b6f1c05)) * instrumentation and session managers ([#1](#1)) ([a072154](a072154)) * instrumentation, client, sdk, crash report, network ([2255e48](2255e48)) * instrumentation, client, sdk, crash report, network ([#5](#5)) ([df712ab](df712ab)) * ios26 transition ([0853a19](0853a19)) * plugin implementation ([c38588c](c38588c)) * plugin implementation ([#4](#4)) ([1849209](1849209)) * sampling api ([#10](#10)) ([242149f](242149f)) * set sampling config via graphql client ([#19](#19)) ([500f550](500f550)) * swipe tracker ([4fca19d](4fca19d)) * swipe tracker ([#13](#13)) ([0a302d7](0a302d7)) * **system-metrics:** add auto instrumentation for cpu and memory ([#36](#36)) ([95ca6fc](95ca6fc)) * use apple format for crash report ([1390973](1390973)) ### Bug Fixes * compilation ([bdd3e22](bdd3e22)) * eval hook ([2749468](2749468)) * eval hook ([#8](#8)) ([4b60b80](4b60b80)) * get sampling config ([#21](#21)) ([12e35c7](12e35c7)) * guard inconsistent [weak self] ([59dce74](59dce74)) * Limit Package.swift to iOS and TV ([#34](#34)) ([7d76b65](7d76b65)) * requirement 1.2.3.6 span name in eval hook ([#14](#14)) ([ad15ef9](ad15ef9)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Prepare 0.4.0 release: add changelog and bump manifest version. > > - **Docs**: > - Add `CHANGELOG.md` for `0.4.0`, outlining new features and bug fixes. > - **Release**: > - Bump version in `.release-please-manifest.json` from `0.3.0` to `0.4.0`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 4381ca4. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->