Skip to content

Add feature gate to disable log teeing when telemetry provider is set #13209

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

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

Conversation

ChrsMark
Copy link
Member

Description

This PR adds a feature gate for disabling the console logging when a telemetry provider is configured for the Collector.

Link to tracking issue

Fixes #13019

Testing

Manual testing notes
  1. Start a "back-end" Collector:
docker run \
  -p 127.0.0.1:4318:4318 \
  otel/opentelemetry-collector-contrib:0.128.0 \
  2>&1 | tee collector-output.txt
  1. Using the following configuration, start a Collector with the featureGate enabled:
    config.yaml:
receivers:
  otlp:
    protocols:
      grpc:
        endpoint: 0.0.0.0:4317

exporters:
  debug:
    verbosity: normal

service:
  telemetry:
    logs:
      processors:
        - batch:
            exporter:
              otlp:
                protocol: http/protobuf
                endpoint: http://0.0.0.0:4318

  pipelines:
    metrics:
      receivers: [otlp]
      exporters: [debug]

./bin/otelcorecol_darwin_arm64 --config ~/otelcol/corecol/config.yaml --feature-gates=+telemetry.disableConsoleLoggingWhenProviderEnabled

  1. Ensure that the back-end Collector receives the logs and that the monitored Collector does not log to the console

Documentation

Probably https://opentelemetry.io/docs/collector/internal-telemetry/ could mention the feature gate.

@ChrsMark ChrsMark requested a review from a team as a code owner June 16, 2025 13:18
@ChrsMark ChrsMark requested a review from dmitryax June 16, 2025 13:18
Copy link

codecov bot commented Jun 16, 2025

Codecov Report

Attention: Patch coverage is 81.81818% with 2 lines in your changes missing coverage. Please review.

Project coverage is 91.51%. Comparing base (8d71881) to head (51d1eaa).

Files with missing lines Patch % Lines
service/telemetry/logger.go 81.81% 1 Missing and 1 partial ⚠️

❌ Your patch check has failed because the patch coverage (81.81%) is below the target coverage (95.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13209      +/-   ##
==========================================
- Coverage   91.51%   91.51%   -0.01%     
==========================================
  Files         522      522              
  Lines       28988    28998      +10     
==========================================
+ Hits        26529    26537       +8     
- Misses       1939     1940       +1     
- Partials      520      521       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ChrsMark ChrsMark force-pushed the fg_teeing branch 6 times, most recently from 7485273 to 8b43a72 Compare June 18, 2025 08:00
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.

add a feature gate that disables the tee'ing of the logs.
1 participant