azure-sdk-for-java icon indicating copy to clipboard operation
azure-sdk-for-java copied to clipboard

OpenTelemetry Metrics Support For Live Metrics

Open navsukumar opened this issue 1 year ago • 5 comments

Summary: This PR enables Open Telemetry metrics to be streamed and seen on the Live Metrics UX. Includes functionality to collect, store, and send requested open telemetry metrics.

QuickPulseConfiguration:

  • Contains logic for extracting and holding the eTag and requested metrics from PING/POST requests when a user makes a request for certain Open Telemetry metrics on the Live Metrics UX.
  • Updated invariant version to 6. 6 represents that Java SDK supports Open Telemetry metrics but not live filtering, 7 represents that Java SDK supports both.
  • Keeps track of eTag and concurrent HashMap of requested Open Tel metrics, with getter and setter methods for both.
  • The parseMetrics( ) method parses the user requested metrics in the response of the PING or POST requests into OpenTelMetricInfo objects before storing them.
  • All methods in QuickPulseConfiguration have been synchronized for multi-threading.

QuickPulseCollector:

  • Added OpenTelMetricsStorage to handle logic of storing and retrieving Open Tel metrics.
  • Limited number of Open Tel metrics that can be stored at any given time to 50, and the amount of time to wait before declaring a metric inactive to 5 minutes. These will be reviewed based on customer needs.
  • Whenever a post request is being made, the processMetrics() method is called. Metrics that have surpassed the buffer time are declared inactive and deleted, metrics that have been requested by the user are sent to processMetric( ) to be aggregated and formatted accordingly. All data points for each metric are cleared as well.
  • OpenTelDataPoint and OpenTelMetric are the data models used to store metrics inside of OpenTelMetricsStorage.

QuickPulseDataFetcher:

  • Modified to append user-requested Open Tel metrics to the list of standard metrics when addMetricsToQuickPulseEnvelope() is called.

QuickPulseDataSender:

  • Modified to also update QuickPulseConfiguration with etag and requested metrics from response of POST if new eTag has been detected.

QuickPulsePingSender:

  • Modified to update QuickPulseConfiguration with etag and requested metrics when PING response contains a "x-ms-qps-subscribed: true" header.

QuickPulseMetricReader.

  • Contains logic for retrieving raw metrics Open Telemetry has collected via collectAllMetrics().

QuickPulseMetricReceiver.

  • Runs on separate thread. Calls the collectAllMetrics() in QuickPulseMetricReader every 1 second and sends collected metrics to QuickPulseDataCollector if QuickPulse is active.

navsukumar avatar Jul 19 '24 23:07 navsukumar

Thank you for your contribution @navsukumar! We will review the pull request and get back to you soon.

github-actions[bot] avatar Jul 19 '24 23:07 github-actions[bot]

API change check

API changes are not detected in this pull request.

azure-sdk avatar Jul 20 '24 00:07 azure-sdk

Hi @navsukumar. Thank you for your interest in helping to improve the Azure SDK experience and for your contribution. We've noticed that there hasn't been recent engagement on this pull request. If this is still an active work stream, please let us know by pushing some changes or leaving a comment. Otherwise, we'll close this out in 7 days.

github-actions[bot] avatar Oct 18 '24 05:10 github-actions[bot]

Valuable change, hope it will be rejuvenated.

Trass3r avatar Oct 18 '24 16:10 Trass3r

Hi @navsukumar. Thank you for your contribution. Since there hasn't been recent engagement, we're going to close this out. Feel free to respond with a comment containing /reopen if you'd like to continue working on these changes. Please be sure to use the command to reopen or remove the no-recent-activity label; otherwise, this is likely to be closed again with the next cleanup pass.

github-actions[bot] avatar Oct 25 '24 20:10 github-actions[bot]

To continue work here in a different fork: https://github.com/Azure/azure-sdk-for-java/pull/43564

benke520 avatar Dec 23 '24 23:12 benke520