Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 29 additions & 19 deletions eFormAPI/Plugins/Workflow.Pn/Workflow.Pn/EformWorkflowPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,28 +100,38 @@ public void ConfigureOptionsServices(IServiceCollection services, IConfiguration
configuration.GetSection("WorkflowBaseSettings"));
}

// Declared once, as <AssemblyMetadata Include="SentryDsn" /> in the csproj: the API host reads the
// same assembly metadata to route this plugin's events to its own Sentry project.
private static string SentryDsn =>
typeof(EformWorkflowPlugin).Assembly
.GetCustomAttributes<AssemblyMetadataAttribute>()
.FirstOrDefault(x => x.Key == "SentryDsn")?.Value;

public void ConfigureDbContext(IServiceCollection services, string connectionString)
{
SentrySdk.Init(options =>
if (!string.IsNullOrWhiteSpace(SentryDsn))
{
// A Sentry Data Source Name (DSN) is required.
// See https://docs.sentry.io/product/sentry-basics/dsn-explainer/
// You can set it in the SENTRY_DSN environment variable, or you can set it in code here.
options.Dsn = "https://80b935299e69fe24c21043140b62f2ab@o4506241219428352.ingest.us.sentry.io/4508266849501184";

// When debug is enabled, the Sentry client will emit detailed debugging information to the console.
// This might be helpful, or might interfere with the normal operation of your application.
// We enable it here for demonstration purposes when first trying Sentry.
// You shouldn't do this in your applications unless you're troubleshooting issues with Sentry.
options.Debug = false;

// This option is recommended. It enables Sentry's "Release Health" feature.
options.AutoSessionTracking = true;

// This option is recommended for client applications only. It ensures all threads use the same global scope.
// If you're writing a background service of any kind, you should remove this.
options.IsGlobalModeEnabled = true;
});
SentrySdk.Init(options =>
{
// A Sentry Data Source Name (DSN) is required.
// See https://docs.sentry.io/product/sentry-basics/dsn-explainer/
// You can set it in the SENTRY_DSN environment variable, or you can set it in code here.
options.Dsn = SentryDsn;

// When debug is enabled, the Sentry client will emit detailed debugging information to the console.
// This might be helpful, or might interfere with the normal operation of your application.
// We enable it here for demonstration purposes when first trying Sentry.
// You shouldn't do this in your applications unless you're troubleshooting issues with Sentry.
options.Debug = false;

// This option is recommended. It enables Sentry's "Release Health" feature.
options.AutoSessionTracking = true;

// This option is recommended for client applications only. It ensures all threads use the same global scope.
// If you're writing a background service of any kind, you should remove this.
options.IsGlobalModeEnabled = true;
});
}

var pattern = @"Database=(\d+)_eform-angular-workflow-plugin;";
var match = Regex.Match(connectionString!, pattern);
Expand Down
4 changes: 4 additions & 0 deletions eFormAPI/Plugins/Workflow.Pn/Workflow.Pn/Workflow.Pn.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>

<ItemGroup>
<AssemblyMetadata Include="SentryDsn" Value="https://80b935299e69fe24c21043140b62f2ab@o4506241219428352.ingest.us.sentry.io/4508266849501184" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="Resources\localization.json" />
<None Remove="Resources\Templates\page.html" />
Expand Down
Loading