opentelemetry-operations-python icon indicating copy to clipboard operation
opentelemetry-operations-python copied to clipboard

Use experimental metrics api

Open ksmets opened this issue 3 years ago • 1 comments

As I wanted to enable both tracing and monitoring in one project, I modified the code to use the experimental metrics api.

Keep in mind that I made the following assumptions:

  • keep the start and end times of the exported metrics as is
  • bounds and values of histogram are of equal length

Moreover I added locking when accessing the metric descriptors (otherwise test_cloud_monitoring_exporter_integration.py would fail randomly). I introduced metrictestutil.py with convenience functions to create metrics (based on https://github.com/open-telemetry/opentelemetry-python/blob/main/tests/opentelemetry-test-utils/src/opentelemetry/test/metrictestutil.py)

ksmets avatar May 16 '22 07:05 ksmets

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

For more information, open the CLA check for this pull request.

google-cla[bot] avatar May 16 '22 07:05 google-cla[bot]

Thanks for taking a stab at this. I've opened a separate PR https://github.com/GoogleCloudPlatform/opentelemetry-operations-python/pull/204 and decided to gut some of the code and tests as so much of it is no longer applicable.

aabmass avatar Nov 07 '22 18:11 aabmass