Skip to content

Add deployment environments to events - #371

Open
ejsmith wants to merge 12 commits into
mainfrom
feature/event-environments
Open

ejsmith wants to merge 12 commits into
mainfrom
feature/event-environments

Conversation

@ejsmith

@ejsmith ejsmith commented Sep 10, 2026 •

Copy link
Copy Markdown
Member

Adds Configuration.Environment, fluent SetEnvironment(...) helpers, and configuration/environment-variable support for deployment environments. Hosting integration falls back to IHostEnvironment.EnvironmentName; per-event settings override the default.

Environment values retain their supplied casing after trimming. Search and aggregation normalization happens on the server, which continues grouping the same error into one stack. Duplicate detection preserves distinct event payloads.

Validation: Linux, macOS, and Windows CI, including net472 configuration tests. Focused regressions cover invalid overrides, host defaults, reuse, caller-owned clients, aggregate exceptions, exclusion callbacks, and reading Exceptionless:Environment through IConfiguration and both DI factory overloads. No breaking public APIs.

Server support shipped in Exceptionless #2570. Self-hosted installs should upgrade the server first: the hosting integration sets the environment automatically from IHostEnvironment, and an older server stores the root environment as custom data.environment.

Related PRs: Exceptionless #2570, Exceptionless.JavaScript #193.

Copilot AI lite review requested due to automatic review settings September 10, 2026 03:32
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T12:52:48.983265Z 3785ce2 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI 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.

🟡 Changes recommended

The DI registration change for externally provided ExceptionlessClient may alter disposal/ownership semantics in a potentially breaking way and should be clarified/adjusted before approval.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR introduces first-class “deployment environment” support in the Exceptionless .NET client so events can be tagged (and deduplicated) by environment while keeping existing runtime/environment diagnostics separate.

Changes:

  • Add ExceptionlessConfiguration.Environment (default) and Event.Environment (per-event override) with consistent normalization/validation.
  • Add fluent helpers (SetEnvironment(...)) and support reading the environment from IConfiguration and environment variables.
  • Update hosting integration to fall back to IHostEnvironment.EnvironmentName, and extend tests to cover serialization, defaults, hosting, and duplicate detection behavior.
File summaries
File Description
test/Exceptionless.Tests/Serializer/Models/EventSerializerTests.cs Adds JSON round-trip coverage ensuring top-level environment is distinct from data.@environment.
test/Exceptionless.Tests/Plugins/910_DuplicateCheckerPluginTests.cs Verifies duplicate detection behavior is scoped to environment.
test/Exceptionless.Tests/Plugins/015_ConfigurationDefaultsPluginTests.cs Ensures default environment applies only when the event doesn’t override it.
test/Exceptionless.Tests/Platforms/HostingExtensionsTests.cs Validates hosting fallback to IHostEnvironment.EnvironmentName when not explicitly configured.
test/Exceptionless.TestHarness/Serializer/StorageSerializerTestBase.cs Includes environment in harness event creation for storage serialization coverage.
src/Platforms/Exceptionless.Extensions.Hosting/ExceptionlessExtensions.cs Applies hosting fallback for environment during DI registration/resolution.
src/Exceptionless/Utility/DeploymentEnvironment.cs Introduces centralized environment normalization/validation logic.
src/Exceptionless/Plugins/Default/015_ConfigurationDefaultsPlugin.cs Applies default configuration environment to events when unspecified.
src/Exceptionless/Models/Client/Event.cs Adds Event.Environment, includes it in equality/hash, and serializes it as top-level environment.
src/Exceptionless/Extensions/ExceptionlessConfigurationExtensions.cs Adds configuration helper and reads environment from config/env vars.
src/Exceptionless/Extensions/EventBuilderExtensions.cs Adds EventBuilder.SetEnvironment(...) for per-event overrides.
src/Exceptionless/Configuration/ExceptionlessConfiguration.cs Adds ExceptionlessConfiguration.Environment with normalization/validation.
README.md Documents environment configuration, overrides, normalization rules, and separation from runtime metadata.
Review details
  • Files reviewed: 14/14 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/Platforms/Exceptionless.Extensions.Hosting/ExceptionlessExtensions.cs Outdated
Comment thread src/Exceptionless/Utility/DeploymentEnvironment.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: 6f4f13670b

ℹ️ 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 src/Exceptionless/Plugins/Default/015_ConfigurationDefaultsPlugin.cs Outdated
Comment thread src/Exceptionless/Extensions/ExceptionlessConfigurationExtensions.cs Outdated
@ejsmith

ejsmith commented Sep 10, 2026

Copy link
Copy Markdown
Member 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: 2ac945eb94

ℹ️ 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 src/Platforms/Exceptionless.Extensions.Hosting/ExceptionlessExtensions.cs Outdated
@ejsmith

ejsmith commented Sep 10, 2026

Copy link
Copy Markdown
Member 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: 5f875dcdd6

ℹ️ 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 src/Platforms/Exceptionless.Extensions.Hosting/ExceptionlessExtensions.cs Outdated
@ejsmith

ejsmith commented Sep 10, 2026

Copy link
Copy Markdown
Member 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: fca9d0e0b3

ℹ️ 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 src/Exceptionless/Models/Client/Event.cs Outdated
@ejsmith

ejsmith commented Sep 10, 2026

Copy link
Copy Markdown
Member 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: cb3f2150ef

ℹ️ 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 src/Exceptionless/Plugins/Default/015_ConfigurationDefaultsPlugin.cs Outdated
@ejsmith

ejsmith commented Sep 10, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 609fe96b8d

ℹ️ 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".

@ejsmith

ejsmith commented Sep 10, 2026

Copy link
Copy Markdown
Member Author

@codex review

@ejsmith

ejsmith commented Sep 10, 2026

Copy link
Copy Markdown
Member 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: 1e984cd781

ℹ️ 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".

Cover reading Exceptionless:Environment from IConfiguration and both DI
factory overloads, and document that a configured empty value stays
unspecified and that Startup re-reads environment variables.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ejsmith

ejsmith commented Oct 21, 2026

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@ejsmith

ejsmith commented Oct 21, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: a315b7dd38

ℹ️ 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".

Startup re-reads environment variables (and, on .NET Framework, the
configuration file), which replaced an environment set in code.
Configuration sources now apply only when code has not set one, and
later sources still replace earlier ones.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ejsmith

ejsmith commented Oct 21, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 3785ce2b8a

ℹ️ 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".

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