Skip to content

Add new connection string for application insights - #1011

Merged
eskebab merged 2 commits into
mainfrom
enhancement-1010-stricter-exporter-config
Aug 5, 2026
Merged

Add new connection string for application insights#1011
eskebab merged 2 commits into
mainfrom
enhancement-1010-stricter-exporter-config

Conversation

@eskebab

@eskebab eskebab commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Description

Related Issue(s)

Verification

  • Your code builds clean without any errors or warnings
  • Manual testing done (required)
  • Relevant automated test added (if you find this hard, leave it and we'll help out)
  • All tests run green

Documentation

  • User documentation is updated with a separate linked PR in altinn-studio-docs. (if applicable)

Summary by CodeRabbit

  • Bug Fixes
    • Improved Azure Monitor telemetry configuration by using the configured Application Insights connection string directly.
    • Telemetry export remains enabled only when a valid connection string is provided.

@eskebab eskebab self-assigned this Aug 5, 2026
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@eskebab, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 41 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ba07e7d6-6865-4629-a59b-2ae6acf7d7a0

📥 Commits

Reviewing files that changed from the base of the PR and between 7461e0f and 5f36105.

📒 Files selected for processing (1)
  • src/Altinn.Profile/Program.cs
📝 Walkthrough

Walkthrough

This PR updates Azure Monitor telemetry setup in application startup. The code now reads ApplicationInsights:ConnectionString directly. It stops exporter setup when the connection string is missing.

Changes

Telemetry configuration

Layer / File(s) Summary
Direct connection string lookup
src/Altinn.Profile/Program.cs
AddAzureMonitorTelemetryExporters now reads ApplicationInsights:ConnectionString directly. The code returns when that value is empty or missing. It no longer reads ApplicationInsights:InstrumentationKey or constructs a connection string.

Estimated code review effort: 1 (Trivial) | ~4 minutes

Possibly related issues

  • Altinn/altinn-profile#1010 — The PR changes Program.cs to use ApplicationInsights:ConnectionString directly instead of building it from ApplicationInsights:InstrumentationKey.

Suggested reviewers: sigridbra, sandgrainone, hggutvik

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: using a new Application Insights connection string.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch enhancement-1010-stricter-exporter-config

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@eskebab
eskebab requested a review from Ahmed-Ghanam August 5, 2026 13:39

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/Altinn.Profile/Program.cs`:
- Around line 225-227: Update the Application Insights connection-string
validation near applicationInsightsConnectionString to use
string.IsNullOrWhiteSpace instead of string.IsNullOrEmpty, ensuring
whitespace-only values are rejected before configuring the Azure Monitor
exporters.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 04a993ab-b6b1-4a09-bc5a-59bd857b77f4

📥 Commits

Reviewing files that changed from the base of the PR and between eee6887 and 7461e0f.

📒 Files selected for processing (1)
  • src/Altinn.Profile/Program.cs

Comment thread src/Altinn.Profile/Program.cs Outdated
@sonarqubecloud

sonarqubecloud Bot commented Aug 5, 2026

Copy link
Copy Markdown

@eskebab
eskebab merged commit 732ba9a into main Aug 5, 2026
12 of 13 checks passed
@eskebab
eskebab deleted the enhancement-1010-stricter-exporter-config branch August 5, 2026 14:01
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