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

Add configuration for tracing log #531

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

YaSuenag
Copy link
Contributor

Pull Request

Summary

Introduce new configuration EnableTelemetryLogging into CarbonAwareVars. This configures whether console exporter by OpenTelemetry is enabled. If you set this to false, following log would be gone:

Activity.TraceId:            46ba0749bdd2381c8f8aded1986e74b2
Activity.SpanId:             bcb76b5718c7df35
Activity.TraceFlags:         Recorded
Activity.ActivitySourceName: Microsoft.AspNetCore
Activity.DisplayName:        /health
Activity.Kind:               Server
Activity.StartTime:          2024-06-12T10:36:51.3093434Z
Activity.Duration:           00:00:00.0221267
Activity.Tags:
    net.host.name: localhost
    net.host.port: 8080
    http.method: GET
    http.scheme: http
    http.target: /health
    http.url: http://localhost:8080/health
    http.flavor: 1.1
    http.user_agent: curl/8.5.0
    http.status_code: 200
Resource associated with Activity:
    service.name: CarbonAware.WebAPI
    service.version: 1.0.0
    service.instance.id: d482b5d5-4448-4281-8da8-37677e70e389
    telemetry.sdk.name: opentelemetry
    telemetry.sdk.language: dotnet
    telemetry.sdk.version: 1.6.0

This configuration is set to true by default, so this change does not change current behavior.

Changes

  • Add EnableTelemetryLogging
  • Move console exporter configuration to ServiceCollectionExtensions.cs from Program.cs
  • Update document
  • Update unit test

Checklist

  • Local Tests Passing?
  • CICD and Pipeline Tests Passing?
  • Added any new Tests?
  • Documentation Updates Made?
  • Are there any API Changes? If yes, please describe below.
  • This is not a breaking change. If it is, please describe it below.

Are there API Changes?

No

Is this a breaking change?

No

Signed-off-by: Yasumasa Suenaga <[email protected]>
@danuw
Copy link
Collaborator

danuw commented Aug 27, 2024

@vaughanknight to review - it is meant to reduce telemetry by removing all console logs.

@danuw danuw added v1.6 Ready for Review PR Ready for review with the GSF team for merge labels Aug 27, 2024
@danuw danuw added v1.7 and removed v1.6 labels Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready for Review PR Ready for review with the GSF team for merge v1.7
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants