Skip to content

Conversation

ambushwork
Copy link
Member

What does this PR do? What is the motivation?

Merge instructions

Merge readiness:

  • Ready for merge

For Datadog employees:

Your branch name MUST follow the <name>/<description> convention and include the forward slash (/). Without this format, your pull request will not pass CI, the GitLab pipeline will not run, and you won't get a branch preview. Getting a branch preview makes it easier for us to check any issues with your PR, such as broken links.

If your branch doesn't follow this format, rename it or create a new branch and PR.

[6/5/2025] Merge queue has been disabled on the documentation repo. If you have write access to the repo, the PR has been reviewed by a Documentation team member, and all of the required checks have passed, you can use the Squash and Merge button to merge the PR. If you don't have write access, or you need help, reach out in the #documentation channel in Slack.

Additional notes

Copy link
Contributor

ℹ️ Documentation Team Review

No documentation team review is required for this pull request.

Copy link
Contributor

@ambushwork ambushwork force-pushed the yl/RUM-10436/update-sdk-logs branch 2 times, most recently from b1846cb to 75638f3 Compare August 27, 2025 11:04
@ambushwork ambushwork force-pushed the yl/RUM-10436/update-sdk-logs branch from 75638f3 to 6c7e361 Compare August 27, 2025 14:04
@ambushwork ambushwork marked this pull request as ready for review August 27, 2025 14:05
@ambushwork ambushwork requested review from a team as code owners August 27, 2025 14:05
Comment on lines +510 to +512
```kotlin

// This adds an attribute "version_code" with an integer value in all logs instance.
Copy link
Member

@0xnm 0xnm Aug 27, 2025

Choose a reason for hiding this comment

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

Suggested change
```kotlin
// This adds an attribute "version_code" with an integer value in all logs instance.
```kotlin
// This adds an attribute "version_code" with an integer value in all Logs instances.


```kotlin

// This adds an attribute "version_code" with an integer value in all logs instance.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// This adds an attribute "version_code" with an integer value in all logs instance.
// This adds an attribute "version_code" with an integer value in all Logs instances.

// This adds an attribute "version_code" with an integer value in all logs instance.
Logs.addAttribute("version_code", BuildConfig.VERSION_CODE)

// This adds an attribute "version_name" with a String value in all logs instance.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// This adds an attribute "version_name" with a String value in all logs instance.
// This adds an attribute "version_name" with a String value in all Logs instances.

Comment on lines +533 to +541
To remove a global attribute from all Logs instances:

```kotlin
// This removes the attribute "version_code" from all logs instance.
Logs.removeAttribute("version_code")

// This removes the attribute "version_name" from all logs instance.
Logs.removeAttribute("version_name")
```
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
To remove a global attribute from all Logs instances:
```kotlin
// This removes the attribute "version_code" from all logs instance.
Logs.removeAttribute("version_code")
// This removes the attribute "version_name" from all logs instance.
Logs.removeAttribute("version_name")
```
To remove a global attribute from all Logs instances:
```kotlin
// This removes the attribute "version_code" from all Logs instances.
Logs.removeAttribute("version_code")
// This removes the attribute "version_name" from all Logs instances.
Logs.removeAttribute("version_name")

{{< tabs >}}
{{% tab "Swift" %}}
```swift
// This adds an attribute "device-model" with a string value in all logs instance.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// This adds an attribute "device-model" with a string value in all logs instance.
// This adds an attribute "device-model" with a string value in all Logs instances.

@@ -533,7 +549,7 @@ Use the `removeAttribute(forKey:)` method to remove a custom attribute from all
{{< tabs >}}
{{% tab "Swift" %}}
```swift
// This removes the attribute "device-model" from all further log send.
// This removes the attribute "device-model" from all further log sent from this logger instance.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// This removes the attribute "device-model" from all further log sent from this logger instance.
// This removes the attribute "device-model" from all further logs sent from this logger instance.

{{< tabs >}}
{{% tab "Swift" %}}
```swift
// This removes the attribute "device-model" from all further log sent from all logger instance.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// This removes the attribute "device-model" from all further log sent from all logger instance.
// This removes the attribute "device-model" from all further logs sent from all logger instances.

@rtrieu rtrieu self-assigned this Aug 27, 2025
Copy link
Contributor

@rtrieu rtrieu left a comment

Choose a reason for hiding this comment

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

a minor feedback, but otherwise looks good.

logger.addAttribute("version_name", BuildConfig.VERSION_NAME)
```

Attributes can be added globally across all Logs instances using:
Copy link
Contributor

Choose a reason for hiding this comment

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

When would a user want to use logger-specific vs global attributes? Can we add one sentence explaining that?

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.

3 participants