Skip to content

OpenTelemetry Metrics Support For Live Metrics #41220

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

Closed
wants to merge 56 commits into from

Conversation

navsukumar
Copy link

@navsukumar navsukumar commented Jul 19, 2024

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.

t-nsukumar and others added 30 commits July 3, 2024 10:55
Resolving Merge Conflicts
@navsukumar navsukumar requested a review from harsimar July 24, 2024 22:51
public void run() {
while (true) {

Collection<MetricData> metrics = quickPulseMetricReader.collectAllMetrics();
Copy link
Member

@harsimar harsimar Aug 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an expensive operation - may want to introduce 1s delay when going from off to on so we're not reading the last timeframe of metrics.

Copy link
Contributor

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 github-actions bot added the no-recent-activity There has been no recent activity on this issue. label Oct 18, 2024
@Trass3r
Copy link

Trass3r commented Oct 18, 2024

Valuable change, hope it will be rejuvenated.

Copy link
Contributor

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 github-actions bot closed this Oct 25, 2024
@benke520
Copy link
Member

To continue work here in a different fork: #43564

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Community Contribution Community members are working on the issue customer-reported Issues that are reported by GitHub users external to the Azure organization. no-recent-activity There has been no recent activity on this issue. OpenTelemetry OpenTelemetry instrumentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants