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

Add generics to metric instruments & instrument provider #3406

Closed
wants to merge 2 commits into from

Conversation

leewoobin789
Copy link

There are no differences between float64 and int64 in each async instrument and sync instrument.

it would immensely help on simplifying the implementation of further features in go-contrib, avoiding many boilerplates.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Oct 28, 2022

CLA Missing ID CLA Not Signed

@codecov
Copy link

codecov bot commented Oct 28, 2022

Codecov Report

Merging #3406 (edb3716) into main (3dd4e81) will increase coverage by 0.0%.
The diff coverage is 92.4%.

❗ Current head edb3716 differs from pull request most recent head fc0d1c5. Consider uploading reports for the commit fc0d1c5 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #3406   +/-   ##
=====================================
  Coverage   77.9%   77.9%           
=====================================
  Files        164     164           
  Lines      11361   11361           
=====================================
+ Hits        8855    8859    +4     
+ Misses      2307    2303    -4     
  Partials     199     199           
Impacted Files Coverage Δ
sdk/metric/instrument.go 83.3% <ø> (ø)
metric/internal/global/instruments.go 54.3% <72.2%> (ø)
metric/internal/global/meter.go 96.4% <100.0%> (ø)
metric/noop.go 100.0% <100.0%> (ø)
sdk/metric/instrument_provider.go 80.0% <100.0%> (ø)
sdk/metric/meter.go 100.0% <100.0%> (ø)
exporters/jaeger/jaeger.go 91.1% <0.0%> (+0.8%) ⬆️
sdk/trace/batch_span_processor.go 81.1% <0.0%> (+0.8%) ⬆️

@MrAlias
Copy link
Contributor

MrAlias commented Oct 28, 2022

it would immensely help on simplifying the implementation of further features in go-contrib, avoiding many boilerplates.

Can you please justify this statement?

Copy link
Contributor

@MrAlias MrAlias left a comment

Choose a reason for hiding this comment

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

This will not support users using Go < 1.18.

@MrAlias MrAlias added blocked:CLA Waiting on CLA to be signed before progress can be made response needed Waiting on user input before progress can be made labels Oct 28, 2022
@leewoobin789
Copy link
Author

leewoobin789 commented Oct 29, 2022

@MrAlias
fair point. however i suppose that the support under 1.18 is anyway abandoned in the current version, because the code already makes use of generics ( for instance sdk/metric/instrument.go). doesn't it?

The simplication could occur in the way that you don't need to define same function twice, when it comes to handling both int64 and float64 types.

Thanks!

p.s.
btw. somehow EasyCLA does not accept me as contributor. I have already registered as individual contributor in opentelemetry-collector-contrib, however I am facing a weird issue that redirects me back to my last (closed) PR in contrib repo.

@MrAlias
Copy link
Contributor

MrAlias commented Oct 29, 2022

@MrAlias fair point. however i suppose that the support under 1.18 is anyway abandoned in the current version, because the code already makes use of generics ( for instance sdk/metric/instrument.go). doesn't it?

The SDK is a separate module from the API, it does not impose a limitation on the API. This is by design: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/overview.md.

Please see the existing discussion on the topic and the ultimate SIG decision: #2494 (comment)

@leewoobin789
Copy link
Author

@MrAlias
I see. Thank you for the information. I will close down this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked:CLA Waiting on CLA to be signed before progress can be made response needed Waiting on user input before progress can be made
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants