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

Use an interface to cleanly switch between different implementations of metrics #2699

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

kislaykishore
Copy link
Collaborator

@kislaykishore kislaykishore commented Nov 20, 2024

  • Instead of using package method calls, call methods on metricHandle which is more object-oriented and improves testability.
  • It helps ensure that none of the instances of OpenCensus metrics have been left out since each method of the interface will have to be implemented in both OpenCensus as well as OTel and the other pieces of the code is completely agnostic of OTel/OC.
  • Use the Strategy design pattern to switch between OC, OTel and no-op implementations of metrics.
  • Currently only OpenCensus implementation is complete. OTel support will be implemented as a follow-up.
  • Extracting metrics related code in one place helps with a better segregation of concerns.

Description

Perf test results
image

Link to the issue in case of a bug fix.

NA

Testing details

  1. Manual - NA
  2. Unit tests - NA
  3. Integration tests - NA

@kislaykishore kislaykishore added execute-perf-test Execute performance test in PR execute-integration-tests Run only integration tests labels Nov 20, 2024
@kislaykishore kislaykishore force-pushed the migrate-to-otel branch 3 times, most recently from 8569833 to 70f232f Compare November 20, 2024 20:51
metrics

* Instead of using package method calls, call methods on metricHandle
  which is more object-oriented and enhances testability.
* Use the Strategy design pattern to switch between OC, OTel
  and no-op implementations of metrics.
* Currently only OpenCensus implementation is complete. OTel support will be
  implemented as a follow-up.
* Extracting metrics related code in one place helps with a better
  segregation of concerns.
@kislaykishore kislaykishore changed the title Use an interface to cleanly switch between different implementations of Use an interface to cleanly switch between different implementations of metrics Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
execute-integration-tests Run only integration tests execute-perf-test Execute performance test in PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant