Skip to content

Conversation

tustanivsky
Copy link
Collaborator

@tustanivsky tustanivsky commented Aug 25, 2025

This PR adds support for configuring the plugin’s DSN, Environment, and Release options via environment variables when they are not set explicitly (useful for CI workflows).

Related docs update:

Closes #1044

Copy link
Contributor

github-actions bot commented Aug 25, 2025

Fails
🚫 Please consider adding a changelog entry for the next release.
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

- Read `DSN`, `Environment` and `Release` options from environment variables ([#1054](https://github.com/getsentry/sentry-unreal/pull/1054))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description or adding a skip-changelog label.

Generated by 🚫 dangerJS against 2217844

cursor[bot]

This comment was marked as outdated.

Copy link
Member

@bruno-garcia bruno-garcia left a comment

Choose a reason for hiding this comment

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

RSLGTM

{
FormattedReleaseName = FString::Printf(TEXT("%s@%s"), *FormattedReleaseName, *Version);
UE_LOG(LogSentrySdk, Log, TEXT("DSN is not set in plugin settings - using SENTRY_DSN environment variable instead."));

Choose a reason for hiding this comment

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

Note: Since Engine config is still priority, we will need to adapt demo when we update the SDK version there.

return EnvVarEnvironment;
}

UE_LOG(LogSentrySdk, Log, TEXT("Using current build configuration as Sentry environment."));

Choose a reason for hiding this comment

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

Do we also want to add a log message when using the environment from engine config? At least verbose. Same for GetEffectiveRelease()

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added a verbose log message when the value from the plugin settings is used (for both release and environment).

*/
FString GetEffectiveEnvironment() const;

FString GetEnvironmentFromBuildConfig() const;

Choose a reason for hiding this comment

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

Let's also add documentation for the two other functions we added here

@tustanivsky tustanivsky merged commit 644bdf5 into main Aug 27, 2025
29 checks passed
@tustanivsky tustanivsky deleted the feat/env-options branch August 27, 2025 11:08
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.

Read plugin options from environment variables
3 participants