-
Notifications
You must be signed in to change notification settings - Fork 2
fix: Fix an issue where logging configuration could over-match for log records without a message or severity. #261
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
Merged
kinyoklion
merged 6 commits into
main
from
rlamb/fix-sampling-over-matching-for-empty-records
Oct 6, 2025
Merged
fix: Fix an issue where logging configuration could over-match for log records without a message or severity. #261
kinyoklion
merged 6 commits into
main
from
rlamb/fix-sampling-over-matching-for-empty-records
Oct 6, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
bugbot review |
…g records without a message or severity.
00fcf18 to
ec85e60
Compare
Vadman97
approved these changes
Oct 3, 2025
…github.com:launchdarkly/observability-sdk into rlamb/fix-sampling-over-matching-for-empty-records
Merged
kinyoklion
pushed a commit
that referenced
this pull request
Oct 6, 2025
🤖 I have created a release *beep* *boop* --- <details><summary>launchdarkly-observability-android: 0.10.0</summary> ## [0.10.0](launchdarkly-observability-android-0.9.0...launchdarkly-observability-android-0.10.0) (2025-10-06) ### Features * Cache OpenTelemetry metric instruments ([#256](#256)) ([db67867](db67867)) </details> <details><summary>go: 0.3.1</summary> ## [0.3.1](go/v0.3.0...go/v0.3.1) (2025-10-06) ### Bug Fixes * Fix an issue where logging configuration could over-match for log records without a message or severity. ([#261](#261)) ([500a6bf](500a6bf)) </details> <details><summary>observability: 0.4.5</summary> ## [0.4.5](observability-0.4.4...observability-0.4.5) (2025-10-06) ### Dependencies * The following workspace dependencies were updated * dependencies * highlight.run bumped to 9.22.2 </details> <details><summary>observability-node: 0.3.1</summary> ## [0.3.1](observability-node-0.3.0...observability-node-0.3.1) (2025-10-06) ### Bug Fixes * Fix an issue where logging configuration could over-match for log records without a message or severity. ([#261](#261)) ([500a6bf](500a6bf)) </details> <details><summary>session-replay: 0.4.5</summary> ## [0.4.5](session-replay-0.4.4...session-replay-0.4.5) (2025-10-06) ### Dependencies * The following workspace dependencies were updated * dependencies * highlight.run bumped to 9.22.2 </details> <details><summary>highlight.run: 9.22.2</summary> ## [9.22.2](highlight.run-9.22.1...highlight.run-9.22.2) (2025-10-06) ### Bug Fixes * Fix an issue where logging configuration could over-match for log records without a message or severity. ([#261](#261)) ([500a6bf](500a6bf)) </details> --- 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] > Release updates across Go, Android, Node, and web packages with a logging bug fix, Android metric instrument caching, and dependency bump to highlight.run 9.22.2. > > - **Releases**: > - `go` → `0.3.1` > - Bug fix: prevent logging config over-matching for records without message/severity. > - Update `go/internal/metadata/metadata.go` InstrumentationVersion to `0.3.1`. > - `sdk/@launchdarkly/observability-node` → `0.3.1` > - Bug fix: same logging over-match fix. > - `sdk/@launchdarkly/observability-android` → `0.10.0` > - Feature: cache OpenTelemetry metric instruments. > - `sdk/@launchdarkly/observability` → `0.4.5` > - Dependency: bump `highlight.run` to `9.22.2`. > - `sdk/@launchdarkly/session-replay` → `0.4.5` > - Dependency: bump `highlight.run` to `9.22.2`. > - `sdk/highlight-run` → `9.22.2` > - Bug fix: logging over-match. > - **Manifest**: update `.release-please-manifest.json` versions accordingly. > - **Packages**: update related `package.json` versions to match. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 7ae2ff1. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
The CustomSampler errantly checked if message and severity were of the correct type before attempting to match them. If they were not, then they matched. The simplest solutions is to not do the check. Alternatively it could do the check, and when the type is not string they do not match.
How did you test this change?
Unit tests.
Other
After this PR is non-js SDKs should have their JSON files updated. I did not update in this PR because I didn't want to trigger a release of those SDKs.
Note
Ensure log rules requiring message/severity only match when the record has a string message/severity; add scenarios and test helpers across SDKs.
go/internal/otel/custom_sampler.go): InmatchesLogConfig, requirerecord.Body()to beKindStringfor message matching; return false otherwise.matchesLogConfigby removing permissive typeof gates; Shared explicitly rejects non-stringrecord.bodyfor message matching.messageandseverityTextdo not match when logs are empty, only have message, or only have severity (in Go/Node/Shared/Highlight Run JSONs).ReadableLogRecordfrom scenario input in Node/Shared tests and update usages.Written by Cursor Bugbot for commit 67c9367. This will update automatically on new commits. Configure here.