Skip to content

sdk/metric: add example for metricdatatest package#7323

Merged
pellared merged 18 commits intoopen-telemetry:mainfrom
sanojsubran:example-metricdatatest
Sep 11, 2025
Merged

sdk/metric: add example for metricdatatest package#7323
pellared merged 18 commits intoopen-telemetry:mainfrom
sanojsubran:example-metricdatatest

Conversation

@sanojsubran
Copy link
Copy Markdown
Contributor

@sanojsubran sanojsubran commented Sep 7, 2025

This PR addresses the issue #7050 by adding an example for the metricdatatest package.

The example uses a manualreader to collect the metrics and verify the expected data against the actual data using the metricdatatest package.

Disclosure: I have used GenAI tools for understanding sections of code base and code changes in this PR, but in a limited way as per the policy guidelines mentioned in the community documentation.

@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented Sep 7, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@flc1125
Copy link
Copy Markdown
Member

flc1125 commented Sep 8, 2025

@sanojsubran Hi, thank you for your contribution. We need to verify it through the CLA before proceeding to review.

https://github.com/open-telemetry/opentelemetry-go/blob/main/CONTRIBUTING.md#how-to-receive-comments

@sanojsubran
Copy link
Copy Markdown
Contributor Author

@flc1125 Sure, I will do it as soon as possible. I am waiting for my employer's approval to sign the CLA.

@flc1125 flc1125 added the blocked:CLA Waiting on CLA to be signed before progress can be made label Sep 8, 2025
@sanojsubran sanojsubran changed the title [WIP] chore(sdk/metric): add example for metricdatatest package sdk/metric: add example for metricdatatest package Sep 9, 2025
@sanojsubran sanojsubran marked this pull request as ready for review September 9, 2025 07:00
@sanojsubran
Copy link
Copy Markdown
Contributor Author

Hi @flc1125,
I have signed the CLA. Kindly review the PR.

@dmathieu dmathieu removed the blocked:CLA Waiting on CLA to be signed before progress can be made label Sep 9, 2025
@dmathieu
Copy link
Copy Markdown
Member

dmathieu commented Sep 9, 2025

I would split this example into several smaller and atomic ones. One for each type of metric for example.
The idea is to have something as trivial as possible, so it can be understood easily.

@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 9, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.9%. Comparing base (e2da30d) to head (6a60a51).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #7323   +/-   ##
=====================================
  Coverage   82.9%   82.9%           
=====================================
  Files        267     267           
  Lines      24982   24982           
=====================================
  Hits       20728   20728           
  Misses      3878    3878           
  Partials     376     376           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@pellared pellared added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Sep 9, 2025
@sanojsubran
Copy link
Copy Markdown
Contributor Author

I would split this example into several smaller and atomic ones. One for each type of metric for example. The idea is to have something as trivial as possible, so it can be understood easily.

@dmathieu Sure, I'll add the changes.

@sanojsubran
Copy link
Copy Markdown
Contributor Author

I have split the examples to separate ones, addressing the exported methods. Kindly review the changes.

Copy link
Copy Markdown
Member

@pellared pellared left a comment

Choose a reason for hiding this comment

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

Same comments apply to other examples

Comment thread sdk/metric/metricdata/metricdatatest/example_test.go Outdated
Comment thread sdk/metric/metricdata/metricdatatest/example_test.go Outdated
Comment thread sdk/metric/metricdata/metricdatatest/example_test.go Outdated
Comment thread sdk/metric/metricdata/metricdatatest/example_test.go Outdated
sanojsubran and others added 5 commits September 10, 2025 21:27
Co-authored-by: Robert Pająk <pellared@hotmail.com>
Co-authored-by: Robert Pająk <pellared@hotmail.com>
Co-authored-by: Robert Pająk <pellared@hotmail.com>
Co-authored-by: Robert Pająk <pellared@hotmail.com>
Signed-off-by: sanojsubran <sanoj.subran@ibm.com>
@sanojsubran
Copy link
Copy Markdown
Contributor Author

@pellared @dmathieu
I have updated the examples with the suggested changes. Kindly check.

Comment thread sdk/metric/metricdata/metricdatatest/example_test.go Outdated
Comment thread sdk/metric/metricdata/metricdatatest/example_test.go Outdated
Comment thread sdk/metric/metricdata/metricdatatest/example_test.go Outdated
Comment thread sdk/metric/metricdata/metricdatatest/example_test.go Outdated
sanojsubran and others added 5 commits September 11, 2025 07:59
Co-authored-by: Flc゛ <four_leaf_clover@foxmail.com>
Co-authored-by: Flc゛ <four_leaf_clover@foxmail.com>
Signed-off-by: sanojsubran <sanoj.subran@ibm.com>
Signed-off-by: sanojsubran <sanoj.subran@ibm.com>
Signed-off-by: sanojsubran <sanoj.subran@ibm.com>
@pellared pellared merged commit 285cbe9 into open-telemetry:main Sep 11, 2025
31 checks passed
@pellared
Copy link
Copy Markdown
Member

@sanojsubran, thank you very much for your contribution 🏅

@sanojsubran sanojsubran deleted the example-metricdatatest branch September 12, 2025 07:27
@MrAlias MrAlias added this to the v1.39.0 milestone Oct 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Skip Changelog PRs that do not require a CHANGELOG.md entry

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants