Skip to content

Conversation

@jmacd
Copy link
Contributor

@jmacd jmacd commented Jan 15, 2026

Part of #1771.

Part of #1736.

As documented in #1741.

Updates that document to match this change reflecting the prototype in #1771.

Revised relative to #1771.

Adds LoggingProviders (choice of default logging provider for global, engine, and internal-telemetry threads).
Adds ProviderMode with names to select instrumentation behavior, with its referring to internal telemetry system.

Note: These settings are somehow not ideally placed. They belong also in the top-level settings, or with observed_state settings. However, since logging is configured with resource and level, which are part of the service::telemetry config area presently, we use that structure. After the bulk of #1736 is finished we can restructure.

@jmacd jmacd requested a review from a team as a code owner January 15, 2026 20:21
@github-actions github-actions bot added the rust Pull requests that update Rust code label Jan 15, 2026
@codecov
Copy link

codecov bot commented Jan 15, 2026

Codecov Report

❌ Patch coverage is 99.26471% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 84.36%. Comparing base (5e2ee27) to head (24ad7ba).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1795      +/-   ##
==========================================
+ Coverage   84.34%   84.36%   +0.01%     
==========================================
  Files         496      496              
  Lines      144435   144547     +112     
==========================================
+ Hits       121829   121942     +113     
+ Misses      22072    22071       -1     
  Partials      534      534              
Components Coverage Δ
otap-dataflow 85.63% <99.26%> (+0.01%) ⬆️
query_abstraction 80.61% <ø> (ø)
query_engine 90.52% <ø> (ø)
syslog_cef_receivers ∅ <ø> (∅)
otel-arrow-go 53.50% <ø> (ø)
quiver 89.81% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jmacd jmacd changed the title Add service::telemetry::logs::{providers, output} settings for internal logging setup Add service::telemetry::logs::providers settings for internal logging setup Jan 16, 2026
Copy link
Contributor

@lquerel lquerel left a comment

Choose a reason for hiding this comment

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

LGTM

- ITS: Use the internal telemetry system.
- OpenTelemetry: Use the OpenTelemetry SDK.
- ConsoleDirect: Synchronously write to the console.
- ConsoleAsync: Synchronously write to the console.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- ConsoleAsync: Synchronously write to the console.
- ConsoleAsync: Asynchronously write to the console.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
pub struct LoggingProviders {
/// Provider mode for non-engine threads. This defines the global Tokio
/// `tracing` subscriber. Default is Unbuffered. Note that Buffered
Copy link
Contributor

Choose a reason for hiding this comment

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

Update to newer terminology instead of mentioning "Buffered" and "Unbuffered".

fn test_validate_engine_otel_requires_global_otel() {
use ProviderMode::*;
// Engine OpenTelemetry without global OpenTelemetry fails
for global in [Noop, ITS, ConsoleDirect] {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
for global in [Noop, ITS, ConsoleDirect] {
for global in [Noop, ITS, ConsoleAsync, ConsoleDirect] {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

}
}

fn default_global_provider() -> ProviderMode {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: These methods can be marked const.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

Comment on lines 100 to 106
fn default_global_provider() -> ProviderMode {
ProviderMode::ITS
}

fn default_engine_provider() -> ProviderMode {
ProviderMode::ITS
}
Copy link
Contributor

Choose a reason for hiding this comment

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

These are not consistent with the default config yaml shared in the self_tracing_architecture.md which has ConsoleAsync as the default.

service:
  telemetry:
    logs:
      level: info
      providers:
        global: console_async
        engine: console_async
        internal: noop

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. In the long term I hope ITS becomes the default, but for now ConsoleAsync is safest.

OpenTelemetry,

/// Asynchronous console logging.
/// The caller writes to a channel the same as ITS deliver, but bypasses
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// The caller writes to a channel the same as ITS deliver, but bypasses
/// The caller writes to a channel the same as ITS delivery, but bypasses

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

/// Returns true if this requires a LogsReporter channel for
/// asynchronous logging.
#[must_use]
pub fn needs_reporter(&self) -> bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
pub fn needs_reporter(&self) -> bool {
pub const fn needs_reporter(&self) -> bool {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. I think I don't fully understand why I should use const keywords.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's mainly to help the compiler apply optimizations. However, marking a method const doesn't guarantee a performance improvement in all cases. The most evident benefit of using const on the method is that it allows your method to be called from const expressions.

On thinking some more, I think we also have to keep in mind that for public methods removing const later would be a breaking change.

@jmacd jmacd enabled auto-merge January 16, 2026 05:27
@jmacd jmacd added this pull request to the merge queue Jan 16, 2026
Merged via the queue into open-telemetry:main with commit 8e6891b Jan 16, 2026
43 checks passed
@jmacd jmacd deleted the jmacd/internal_config_2 branch January 16, 2026 05:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rust Pull requests that update Rust code

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants