Skip to content

Add optional Fields parameter to log query functions - #37

Merged
tustanivsky merged 2 commits into
mainfrom
feat/log-attribute-fields
Feb 12, 2026
Merged

Add optional Fields parameter to log query functions#37
tustanivsky merged 2 commits into
mainfrom
feat/log-attribute-fields

Conversation

@tustanivsky

Copy link
Copy Markdown
Collaborator

This PR adds an optional Fields parameter to Get-SentryLogsByAttribute and Get-SentryTestLog functions that allows callers to request additional log-related fields in the API response.

Motivation: Integration tests for structured logging need to assert on custom log attributes beyond the default field set. Previously, the field list was hardcoded and there was no way to include additional attributes in the response without modifying the module itself.

Example usage:

# Request additional fields in the response
$logs = Get-SentryTestLog -AttributeName 'test_id' -AttributeValue $testId `
    -Fields @('sentry.environment', 'custom_attr')

# Fields are available as properties on returned log objects
$logs[0].'sentry.environment' | Should -Be 'production'

@tustanivsky
tustanivsky merged commit f82cd9c into main Feb 12, 2026
13 checks passed
@tustanivsky
tustanivsky deleted the feat/log-attribute-fields branch March 4, 2026 08:20
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