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

Update MetricReader.collect to call into the MeterProvider's measurement consumer #2331

Closed
aabmass opened this issue Dec 15, 2021 · 4 comments · Fixed by #2401
Closed

Update MetricReader.collect to call into the MeterProvider's measurement consumer #2331

aabmass opened this issue Dec 15, 2021 · 4 comments · Fixed by #2401
Assignees
Labels
1.10.0rc1 release candidate 1 for metrics GA metrics sdk Affects the SDK package.

Comments

@aabmass
Copy link
Member

aabmass commented Dec 15, 2021

Blocked by #2326

Collecting from the SDK is done through MeasurementConsumer.collect(reader) method. When MetricReaders are added to a MeterProvider, they need to be given a handle on this method so they can perform collection. Update MetricReader.collect() to be a final implementation which calls this method.

For one possible implementation, see prototype code

@aabmass aabmass added sdk Affects the SDK package. metrics labels Dec 15, 2021
@lzchen lzchen added the 1.10.0rc1 release candidate 1 for metrics GA label Jan 11, 2022
@srikanthccv
Copy link
Member

With latest merge of metric reader PR, the work left is updating the meter provider initialisation to set callback here?

@srikanthccv srikanthccv self-assigned this Jan 21, 2022
@aabmass
Copy link
Member Author

aabmass commented Jan 21, 2022

It looks like this is actually done @lonewolf3739?

@srikanthccv
Copy link
Member

I don't think it is correct. There is no _register_measurement_consumer on metric reader and self there refers to meter provider. It should be updated to this unless I am missing something.

        for metric_reader in self._sdk_config.metric_readers:
            metric_reader._set_collect_callback(self._measurement_consumer.collect)

@codeboten
Copy link
Contributor

Yup, can confirm that still needs updating @lonewolf3739 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.10.0rc1 release candidate 1 for metrics GA metrics sdk Affects the SDK package.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants