Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to disable legacy telemetry #679

Merged
merged 40 commits into from
May 27, 2024

Conversation

Gnol-VN
Copy link
Member

@Gnol-VN Gnol-VN commented May 21, 2024

Why is this breaking change PR?

This PR to disable legacy ActivityEventSender and OmexLogger default.

How to enable legacy ActivityEventSender and OmexLogger?

In your appsettings.json, put this

{
  "Logging": {
    "Omex": {
      "OmexLoggerEnabled": true
    }
  },
  "Monitoring": {
    "ActivityEventSenderEnabled": true
  }
}

You additionally need this to have these below parts to have your service recognize the appsettings.json.

Make sure that build copies this file to the output folder together with the binaries. For services using Microsoft.NET.Sdk.Web this should happen automatically. For services using Microsoft.NET.Sdk, add the following snippet to your project file:

  <ItemGroup>
    <Content Include="appsettings*.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </Content>
  </ItemGroup>

If you are using ServiceFabric, Ensure working folder is set to CodePackage in ServiceManifest.xml

  <CodePackage Name="Code" Version="1.0.0">
    <EntryPoint>
      <ExeHost>
        <Program>MyService.exe</Program>
        <WorkingFolder>CodePackage</WorkingFolder>
      </ExeHost>
    </EntryPoint>
  </CodePackage>

Reference:

  1. https://learn.microsoft.com/en-us/dotnet/core/extensions/custom-logging-provider
  2. https://www.codeproject.com/Articles/1556475/How-to-Write-a-Custom-Logging-Provider-in-ASP-NET

@Gnol-VN Gnol-VN changed the title Option to enable legacy telemetry Option to disable legacy telemetry May 21, 2024
@Gnol-VN Gnol-VN marked this pull request as ready for review May 21, 2024 21:23
@Gnol-VN Gnol-VN requested a review from a team as a code owner May 21, 2024 21:23
@Gnol-VN Gnol-VN marked this pull request as draft May 22, 2024 10:37
Long Do Thanh added 5 commits May 22, 2024 12:33
…legacyTelemetry' into dothanhl/feature/option_disable_legacyTelemetry

# Conflicts:
#	src/Logging/ServiceCollectionExtensions.cs
#	tests/Logging.UnitTests/OmexLoggerProviderTests.cs
#	tests/Logging.UnitTests/OmexLoggerUnitTests.cs
@Gnol-VN Gnol-VN marked this pull request as ready for review May 22, 2024 14:06
@Gnol-VN Gnol-VN enabled auto-merge (squash) May 22, 2024 14:06
Gnol-VN and others added 3 commits May 27, 2024 10:59
Co-authored-by: artempushkin <32305353+artempushkin@users.noreply.github.com>
@Gnol-VN Gnol-VN requested a review from artempushkin May 27, 2024 10:19
@Gnol-VN Gnol-VN merged commit 6eccc2e into main May 27, 2024
5 checks passed
@Gnol-VN Gnol-VN deleted the dothanhl/feature/option_disable_legacyTelemetry branch May 27, 2024 14:12
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.

4 participants