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

Etw-Metrics - Improvements required #104

Open
cijothomas opened this issue Sep 7, 2024 · 6 comments · May be fixed by #134
Open

Etw-Metrics - Improvements required #104

cijothomas opened this issue Sep 7, 2024 · 6 comments · May be fixed by #134
Assignees

Comments

@cijothomas
Copy link
Member

cijothomas commented Sep 7, 2024

Tracking item for improvements to the Etw-Metrics exporter:
https://github.com/open-telemetry/opentelemetry-rust-contrib/tree/main/opentelemetry-etw-metrics

  1. Avoid heap allocation. It currently uses a vec! for each export. We could re-use the vec!, or use array (allocate maximum etw size - 65360).
  2. It currently serialized the entire batch of metrics and sends them as one etw event. This makes it very easy to hit the 65360 limit on ETW. We need to send one metric at a time to ETW. This is how OTel .NET exports metrics.. This should significantly reduce the probability of hitting ETW size limits.
  3. Unit testing - it should be possible to write unit-tests where an ETW listener is setup and it can validate the metrics are flowing as expected.
@cijothomas
Copy link
Member Author

@mattbodd @psandana Either of you have bandwidth to help with the above, please reply to this issue. Thanks in advance!

@mattbodd
Copy link
Contributor

mattbodd commented Sep 7, 2024

@cijothomas I'd be interested in taking this on!

@cijothomas
Copy link
Member Author

Thanks @mattbodd 2 is higher priority as users are hitting the limit very easily currently. 1 is more like nice-to-have, so lower priority than 2.

@cijothomas
Copy link
Member Author

@utpilla has corrected me that OTel .NET exports every metric point in one etw call, not one Metric. So the same can be followed here too, as that'd make it very safe (from hitting etw limits), even when future improvements like Exemplars come into picture!

@mattbodd
Copy link
Contributor

Thanks @cijothomas for calling out priorities and sharing how the .NET implementation approaches this issue

@cijothomas
Copy link
Member Author

@utpilla has corrected me that OTel .NET exports every metric point in one etw call, not one Metric. So the same can be followed here too, as that'd make it very safe (from hitting etw limits), even when future improvements like Exemplars come into picture!

The above need to be revisited as too many calls to ETW might overwhelm the receiver. So we need more smarter splitting strategy. Following has some ideas worth exploring.
https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/1161/files#diff-6f70559904f5f6d784f8c37f3bd633ce651418dd52944157aee5269071c66e8f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants