Skip to content

[RUM-14555] DdSdk Core Configuration#6

Merged
sbarrio merged 1 commit into
feature/conservativefrom
sbarrio/RUM-13927/sdk-core-configuration
Mar 17, 2026
Merged

[RUM-14555] DdSdk Core Configuration#6
sbarrio merged 1 commit into
feature/conservativefrom
sbarrio/RUM-13927/sdk-core-configuration

Conversation

@sbarrio

@sbarrio sbarrio commented Feb 17, 2026

Copy link
Copy Markdown
Collaborator

Summary

Ref: https://datadoghq.atlassian.net/browse/RUM-14555

Implements the full core SDK configuration layer, wiring DdSdkConfiguration through all three layers of the stack (C# → native bindings → iOS/Android SDKs), and adds comprehensive unit tests at every layer.

Configuration object

New DdSdkConfiguration class under DatadogSdk.Maui.Configuration:

Field Type Default Notes
ClientToken string Required
Environment string Required
TrackingConsent enum Granted Granted, NotGranted, Pending
Site enum Us1 All 7 Datadog regions including Ap2, Us1Fed
Service string? null
Verbosity enum? null DEBUG, INFO, WARN, ERROR
BatchSize enum? null Small, Medium, Large
BatchProcessingLevel enum? null Low, Medium, High
UploadFrequency enum? null Frequent, Average, Rare
Version string? null Injected as _dd.version in additionalConfiguration
VersionSuffix string? null Injected as _dd.version_suffix
AdditionalConfiguration Dictionary<string, object>? null Pass-through for internal keys

BuildAdditionalConfiguration helper

Extracted as a testable internal static method. Merges Version/VersionSuffix into the additional config dict without mutating the source, then passes all keys (including internal ones like _dd.needsClearTextHttp) through to the native layer unchanged.

_dd.needsClearTextHttp support (mirrors dd-sdk-reactnative#1195)

When AdditionalConfiguration["_dd.needsClearTextHttp"] = true is set, the Android native wrapper calls _InternalProxy.allowClearTextHttp(builder), configuring OkHttp for plain HTTP transport. Intended for integration testing against local mock intake servers — not for production use.

The example app includes network_security_config.xml with cleartextTrafficPermitted="true" (referenced from AndroidManifest.xml) to satisfy the Android OS-level cleartext restriction when testing with this flag.

Native wrappers

Both iOS (DatadogWrapper.swift) and Android (DatadogWrapper.kt) initialize() methods extended from 5–6 parameters to 10, accepting the full configuration surface: trackingConsent, batchSize, uploadFrequency, batchProcessingLevel, and additionalConfiguration. iOS applies optional values directly to the Datadog.Configuration struct. Android uses the Configuration.Builder fluent API.

Unit tests

Layer Approach Coverage
C# xUnit Configuration defaults, enum-to-string conversions, BuildAdditionalConfiguration (version-only, suffix-only, both, merge-with-existing, immutability, internal key pass-through)
iOS XCTest One test per configuration value (7 sites, 4 consent values, 3×batch/frequency/level, 5 verbosity levels), service name storage, observable side-effects
Android JUnit + MockK mockkConstructor(Configuration.Builder::class) with answers { self } to keep builder chain intact — verifies exact enum values (DatadogSite.EU1, BatchSize.LARGE, TrackingConsent.PENDING, etc.), _InternalProxy.allowClearTextHttp call

Documentation

Updated README.md, SPEC.md, and AGENTS.md to reflect Phase 2 completion, new API signatures, test infrastructure, and the AdditionalConfiguration internal key pattern.

Test plan

  • All unit tests pass: ./check.sh
  • Full rebuild succeeds: ./build.sh
  • Example app builds and runs on iOS simulator
  • Example app builds and runs on Android emulator
  • Logs appear in Datadog UI: service:datadog-maui-test env:dev

🤖 Generated with Claude Code

@sbarrio sbarrio requested a review from a team as a code owner February 17, 2026 15:42
@sbarrio

sbarrio commented Feb 17, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Feb 17, 2026

Copy link
Copy Markdown

⚠️ Code Quality    ⚠️ Code Vulnerabilities

Fix all issues with BitsAI or with Cursor

⚠️ Warnings

🛠️ 9 Code quality issues detected

Low: csharp-best-practices/static-class (Fix with Cursor) Class should be static View rule
tests/DatadogSdk.Maui.Tests/FileBasedConfigurationTests.cs:7
Low: csharp-code-style/short-variable (Fix with Cursor) Avoid short variable names View rule
tests/DatadogSdk.Maui.Tests/FileBasedConfigurationTests.cs:119
Low: csharp-code-style/short-variable (Fix with Cursor) Avoid short variable names View rule
tests/DatadogSdk.Maui.Tests/FileBasedConfigurationTests.cs:130
View all

🛡️ 1 Code vulnerability detected

Critical: csharp-security/ensure-secure-logging (Fix with Cursor) Ensure no sensitive information is being logged View rule
bindings/DatadogSdk.Maui/DdSdk.cs:46-49
This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 75bd3e4 | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback!

Comment thread bindings/DatadogSdk.Maui/DdLogs.cs
Comment thread bindings/DatadogSdk.Maui/DdLogs.cs
Comment thread bindings/DatadogSdk.Maui/DdSdk.cs
Comment thread bindings/DatadogSdk.Maui/DdLogs.cs
Comment thread bindings/DatadogSdk.Maui/DdLogs.cs
Comment thread bindings/DatadogSdk.Maui/DdLogs.cs
Comment thread bindings/DatadogSdk.Maui/DdLogs.cs
Comment thread bindings/DatadogSdk.Maui/DdLogs.cs
Comment thread bindings/DatadogSdk.Maui/DdSdk.cs
Comment thread bindings/DatadogSdk.Maui/DdLogs.cs
Comment thread bindings/DatadogSdk.Maui/DdLogs.cs
Comment thread bindings/DatadogSdk.Maui/DdLogs.cs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c09b055770

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread native-wrappers/ios/DatadogWrapper/Sources/DatadogWrapper/DatadogWrapper.swift Outdated
Comment thread native-wrappers/ios/DatadogWrapper/Sources/DatadogWrapper/DatadogWrapper.swift Outdated
@sbarrio sbarrio changed the base branch from sbarrio/groundowrk-logs-module-and-documentation to sbarrio/RUM-14554/internal-logger February 18, 2026 09:35

@sbarrio sbarrio left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Looks good, left several comments that need to be addressed though.

Comment thread bindings/DatadogSdk.Maui/Configuration/DatadogSite.cs
Comment thread bindings/DatadogSdk.Maui/DdSdk.cs Outdated
Comment thread bindings/DatadogSdk.Maui/DdSdk.cs
Comment thread example/MauiProgram.cs Outdated
Comment thread native-wrappers/ios/DatadogWrapper/Sources/DatadogWrapper/DatadogWrapper.swift Outdated
Comment thread native-wrappers/ios/DatadogWrapper/Package.swift
Comment thread tests/DatadogSdk.Maui.Tests/DdSdkConfigurationTests.cs
Comment thread tests/DatadogSdk.Maui.Tests/DdSdkConversionTests.cs
Comment thread check.sh
Base automatically changed from sbarrio/RUM-14554/internal-logger to feature/conservative February 19, 2026 11:43
Comment thread bindings/DatadogSdk.Maui/DdSdk.cs
Comment thread bindings/DatadogSdk.Maui/DdSdk.cs
@sbarrio sbarrio force-pushed the sbarrio/RUM-13927/sdk-core-configuration branch from 358619e to a7f44ac Compare March 11, 2026 10:18
@sbarrio

sbarrio commented Mar 11, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a7f44ac997

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread native-wrappers/ios/DatadogWrapper/Sources/DatadogWrapper/DatadogWrapper.swift Outdated
Comment thread bindings/DatadogSdk.Maui/DdSdk.cs Outdated
@sbarrio sbarrio force-pushed the sbarrio/RUM-13927/sdk-core-configuration branch from a7f44ac to 9969f32 Compare March 12, 2026 11:51
Comment thread tests/DatadogSdk.Maui.Tests/FileBasedConfigurationTests.cs
Comment thread tests/DatadogSdk.Maui.Tests/FileBasedConfigurationTests.cs
Comment thread tests/DatadogSdk.Maui.Tests/FileBasedConfigurationTests.cs
Comment thread tests/DatadogSdk.Maui.Tests/FileBasedConfigurationTests.cs
Comment thread tests/DatadogSdk.Maui.Tests/FileBasedConfigurationTests.cs
Comment thread tests/DatadogSdk.Maui.Tests/FileBasedConfigurationTests.cs
Comment thread tests/DatadogSdk.Maui.Tests/FileBasedConfigurationTests.cs
Comment thread bindings/DatadogSdk.Maui/DdSdk.cs
@sbarrio sbarrio self-assigned this Mar 13, 2026
Comment thread example/Platforms/Android/Resources/xml/network_security_config.xml
Comment thread native-wrappers/ios/DatadogWrapper/Sources/DatadogWrapper/DatadogWrapper.swift Outdated

@rgaignault rgaignault left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Good job ! LGTM

@sbarrio sbarrio force-pushed the sbarrio/RUM-13927/sdk-core-configuration branch from 9969f32 to d73f348 Compare March 16, 2026 15:47
Implement DdSdkConfiguration class with full SDK initialization parameters,
pass them through the native bridge to iOS and Android SDKs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@sbarrio sbarrio force-pushed the sbarrio/RUM-13927/sdk-core-configuration branch from d73f348 to 75bd3e4 Compare March 16, 2026 16:00
@sbarrio sbarrio merged commit 03f1838 into feature/conservative Mar 17, 2026
3 checks passed
@sbarrio sbarrio deleted the sbarrio/RUM-13927/sdk-core-configuration branch March 17, 2026 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants