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

Chore/metrics advanced #2204

Merged
merged 7 commits into from
Oct 14, 2024

Conversation

pitoniak32
Copy link
Contributor

Issue That prompted these changes: #1060

References:

Changes

DeltaTemporalitySelector:

  • Moving the DeltaTemporalitySelector to same file as DefaultTemporalitySelector.
  • make the visibility of the struct pub so its usable for pipeline setup.

Example:

  • Update the advanced metrics example to use DeltaTemporalitySelector.

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)

Move Delta selector into same file as Default, and update duplication in
benches.
@pitoniak32 pitoniak32 requested a review from a team as a code owner October 12, 2024 23:33
Copy link

linux-foundation-easycla bot commented Oct 12, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

Copy link

codecov bot commented Oct 12, 2024

Codecov Report

Attention: Patch coverage is 0% with 9 lines in your changes missing coverage. Please review.

Project coverage is 79.0%. Comparing base (42685e8) to head (d28b42a).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
opentelemetry-sdk/src/metrics/reader.rs 0.0% 8 Missing ⚠️
opentelemetry-otlp/src/metric.rs 0.0% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main   #2204     +/-   ##
=======================================
- Coverage   79.0%   79.0%   -0.1%     
=======================================
  Files        122     122             
  Lines      21056   21059      +3     
=======================================
- Hits       16651   16647      -4     
- Misses      4405    4412      +7     

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

@@ -169,7 +169,7 @@ where
///
/// [exporter-docs]: https://github.com/open-telemetry/opentelemetry-specification/blob/a1c13d59bb7d0fb086df2b3e1eaec9df9efef6cc/specification/metrics/sdk_exporters/otlp.md#additional-configuration
pub fn with_delta_temporality(self) -> Self {
self.with_temporality_selector(DeltaTemporalitySelector)
self.with_temporality_selector(DeltaTemporalitySelector::new())
Copy link
Member

Choose a reason for hiding this comment

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

the future of these methods in OTLP crate is unknown based on #1811
However, this change itself is fine.

@@ -44,7 +45,11 @@ fn init_meter_provider() -> opentelemetry_sdk::metrics::SdkMeterProvider {
}
};

let exporter = opentelemetry_stdout::MetricsExporterBuilder::default().build();
// Build exporter using Delta Temporality.
Copy link
Member

Choose a reason for hiding this comment

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

While the concept is somewhat advanced, it is a common ask. Could you make this in the metrics-basic itself, as a code comment, so users can pick between delta vs cumulative by removing commented out code?

(It is possible that we'll have different ways to configure this in the future, but this change is still very good)

Copy link
Member

@cijothomas cijothomas left a comment

Choose a reason for hiding this comment

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

LGTM.
If you can make the change in metrics-basic, that'd be sweet. It is okay to do it in a follow up as well.

@pitoniak32
Copy link
Contributor Author

LGTM.

If you can make the change in metrics-basic, that'd be sweet. It is okay to do it in a follow up as well.

Awesome! I will make the requested changes for this tomorrow for the example.

@cijothomas cijothomas merged commit 3f5c230 into open-telemetry:main Oct 14, 2024
24 of 25 checks passed
@pitoniak32 pitoniak32 deleted the chore/metrics-advanced branch October 16, 2024 12:14
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.

2 participants