Skip to content

Conversation

@andborja
Copy link

Changes

Adds initial declarative configuration support.

Merge requirement checklist

  • CONTRIBUTING guidelines followed
  • Unit tests added/updated (if applicable)
  • Appropriate CHANGELOG.md files updated for non-trivial, user-facing changes
  • Changes in public API reviewed (if applicable)

@andborja andborja requested a review from a team as a code owner November 10, 2025 17:44
@codecov
Copy link

codecov bot commented Nov 10, 2025

Codecov Report

❌ Patch coverage is 88.61076% with 91 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.2%. Comparing base (304a140) to head (0e39a74).

Files with missing lines Patch % Lines
opentelemetry-config/src/providers.rs 78.0% 33 Missing ⚠️
opentelemetry-config/src/lib.rs 83.5% 27 Missing ⚠️
.../src/providers/metrics_provider/reader_provider.rs 91.1% 21 Missing ⚠️
opentelemetry-config/src/model/metrics/reader.rs 93.8% 4 Missing ⚠️
...telemetry-config/src/providers/metrics_provider.rs 93.2% 4 Missing ⚠️
opentelemetry-config-stdout/src/lib.rs 98.8% 1 Missing ⚠️
opentelemetry-config/src/model.rs 97.1% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main    #487     +/-   ##
=======================================
+ Coverage   54.0%   56.2%   +2.1%     
=======================================
  Files         71      78      +7     
  Lines      11782   12581    +799     
=======================================
+ Hits        6370    7078    +708     
- Misses      5412    5503     +91     

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

fn main() -> Result<(), Box<dyn std::error::Error>> {
// Create configuration registry and register console exporter
let mut registry = ConfigurationProvidersRegistry::new();
let metrics_registry = registry.metrics_mut();
Copy link
Member

Choose a reason for hiding this comment

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

Is metrics_mut avoidable by directly providing register_metric_config?

// Load configuration from YAML file
let telemetry_provider = TelemetryProvider::new();
let providers = telemetry_provider
.configure_from_yaml_file(&registry, "otel-config.yaml")?;
Copy link
Member

Choose a reason for hiding this comment

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

Can this be a static method, so we don't need to create instance of TelemetryProvider?


pub fn register_periodic_exporter_factory(
&mut self,
name: String,
Copy link
Member

Choose a reason for hiding this comment

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

The exporter name would be static string - we can make it &'static str or &srr ?

#[derive(serde::Deserialize, Debug)]
#[serde(deny_unknown_fields)]
pub struct Periodic {
pub exporter: serde_yaml::Value,
Copy link
Member

Choose a reason for hiding this comment

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

Add TODO to support missing fields - interval_millis, timeout_millis, etc.

}
}
serde_yaml::Value::Bool(b) => KeyValue::new(key.to_string(), *b),
_ => KeyValue::new(key.to_string(), format!("{:?}", value)),
Copy link
Member

Choose a reason for hiding this comment

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

add TODO to support Array - currently it would be stringified.

Copy link
Member

@lalitb lalitb left a comment

Choose a reason for hiding this comment

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

LGTM for this first iteration. The console and OTLP schemas validated at run-time, and we can revisit the approach later if needed. Thanks for being super patient through all the review rounds - really appreciated.
Also, @utpilla had some solid architecture feedback, so let’s get his final approval before merging.

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.

3 participants