Skip to content

Conversation

@k-wasniowski
Copy link
Contributor

@k-wasniowski k-wasniowski commented May 5, 2025

COMPLETES #SPARK-660018

This pull request addresses

Add metrics on servers subnet reachability.

by making the following changes

Change Type

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Tooling change
  • Internal code refactor

The following scenarios were tested

Tested with JS-SDK sample app

I certified that

  • I have read and followed contributing guidelines

  • I discussed changes with code owners prior to submitting this pull request

  • I have not skipped any automated checks

  • All existing and new tests passed

  • I have updated the documentation accordingly


Make sure to have followed the contributing guidelines before submitting.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 5, 2025

📝 Walkthrough

Walkthrough

The changes introduce tracking and reporting of media server subnet reachability in the Webex Meetings plugin. A new utility method extracts the media server IP from SDP, and this IP is stored as a private property in the Meeting class. During media connection setup, the system checks if the subnet of the media server IP was previously reached using a new method in the Reachability class, which analyzes the subnets gathered during ICE candidate processing. This subnet reachability status is included in behavioral metrics. Related tests are updated and new tests are added to verify the subnet reachability logic and its integration with metrics and ICE candidate handling.

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

yarn install v1.22.22
[1/4] Resolving packages...
warning [email protected]: This version is no longer supported. Please see https://eslint.org/version-support for other options.
warning eslint > @humanwhocodes/[email protected]: Use @eslint/config-array instead
warning eslint > @humanwhocodes/config-array > @humanwhocodes/[email protected]: Use @eslint/object-schema instead
warning eslint > file-entry-cache > flat-cache > [email protected]: Rimraf versions prior to v4 are no longer supported
warning eslint > file-entry-cache > flat-cache > rimraf > [email protected]: Glob versions prior to v9 are no longer supported
warning eslint > file-entry-cache > flat-cache > rimraf > glob > [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
warning eslint-import-resolver-typescript > [email protected]: Glob versions prior to v9 are no longer supported
warning [email protected]: Glob versions prior to v9 are no longer supported
warning intern > [email protected]: Glob versions prior to v9 are no longer supported
warning intern > glob > [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
warning jasmine > [email protected]: Glob versions prior to v9 are no longer supported
warning jest > @jest/core > jest-runtime > [email protected]: Glob versions prior to v9 are no longer supported
warning jest > @jest/core > jest-config > [email protected]: Glob versions prior to v9 are no longer supported
warning jest > @jest/core > @jest/reporters > [email protected]: Glob versions prior to v9 are no longer supported
warning jest > @jest/core > @jest/transform > babel-plugin-istanbul > test-exclude > [email protected]: Glob versions prior to v9 are no longer supported
warning mocha > [email protected]: Glob versions prior to v9 are no longer supported
warning mocha > glob > [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
warning [email protected]: 16.1.1
warning sinon > @sinonjs/samsam > [email protected]: This package is deprecated. Use the optional chaining (?.) operator instead.
warning wd > archiver > [email protected]: Glob versions prior to v9 are no longer supported
warning wd > [email protected]: You or someone you depend on is using Q, the JavaScript Promise library that gave JavaScript developers strong feelings about promises. They can almost certainly migrate to the native JavaScript promise now. Thank you literally everyone for joining me in this bet against the odds. Be excellent to each other.

(For a CapTP with native promises, see @endo/eventual-send and @endo/captp)
warning wd > archiver > archiver-utils > [email protected]: Glob versions prior to v9 are no longer supported
warning wd > [email protected]: request has been deprecated, see request/request#3142
warning wd > request > [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
warning wd > request > [email protected]: this library is no longer supported
warning @babel/cli > [email protected]: Glob versions prior to v9 are no longer supported
warning @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-async-generator-functions instead.
warning @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.
warning @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-export-namespace-from instead.
warning @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead.
warning @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-object-rest-spread instead.
warning @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead.
warning @babel/[email protected]: 🚨 This package has been deprecated in favor of separate inclusion of a polyfill and regenerator-runtime (when needed). See the @babel/polyfill docs (https://babeljs.io/docs/en/babel-polyfill) for more information.
warning @babel/polyfill > [email protected]: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
warning @babel/runtime-corejs2 > [email protected]: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
warning babel-plugin-lodash > [email protected]: Glob versions prior to v9 are no longer supported
warning workspace-aggregator-f754f5b1-a92f-4e66-9183-1a849044e1a2 > [email protected]: This version is no longer supported. Please see https://eslint.org/version-support for other options.
warning workspace-aggregator-f754f5b1-a92f-4e66-9183-1a849044e1a2 > [email protected]: Glob versions prior to v9 are no longer supported
warning workspace-aggregator-f754f5b1-a92f-4e66-9183-1a849044e1a2 > [email protected]: 16.1.1
warning workspace-aggregator-f754f5b1-a92f-4e66-9183-1a849044e1a2 > @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-async-generator-functions instead.
warning workspace-aggregator-f754f5b1-a92f-4e66-9183-1a849044e1a2 > @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.
warning workspace-aggregator-f754f5b1-a92f-4e66-9183-1a849044e1a2 > @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-export-namespace-from instead.
warning workspace-aggregator-f754f5b1-a92f-4e66-9183-1a849044e1a2 > @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead.
warning workspace-aggregator-f754f5b1-a92f-4e66-9183-1a849044e1a2 > @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-object-rest-spread instead.
warning workspace-aggregator-f754f5b1-a92f-4e66-9183-1a849044e1a2 > @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead.
warning workspace-aggregator-f754f5b1-a92f-4e66-9183-1a849044e1a2 > @babel/[email protected]: 🚨 This package has been deprecated in favor of separate inclusion of a polyfill and regenerator-runtime (when needed). See the @babel/polyfill docs (https://babeljs.io/docs/en/babel-polyfill) for more information.
[2/4] Fetching packages...
error [email protected]: The engine "node" is incompatible with this module. Expected version "^14 || ^16 || ^17 || ^18 || ^19". Got "22.9.0"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Tip

⚡️ Faster reviews with caching
  • CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.

Enjoy the performance boost—your workflow just got faster.


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c2f033c and 878d8a1.

📒 Files selected for processing (1)
  • packages/@webex/plugin-meetings/test/unit/spec/reachability/clusterReachability.ts (5 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/@webex/plugin-meetings/test/unit/spec/reachability/clusterReachability.ts
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Build Packages
  • GitHub Check: AWS Amplify Console Web Preview
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@k-wasniowski k-wasniowski force-pushed the feat-metrics-on-reachability-subnet branch from ed8f609 to c1e9e85 Compare May 5, 2025 15:50
@aws-amplify-us-east-2
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-4234.d3m3l2kee0btzx.amplifyapp.com

@k-wasniowski k-wasniowski force-pushed the feat-metrics-on-reachability-subnet branch from c1e9e85 to 90235fc Compare May 6, 2025 09:11
@k-wasniowski k-wasniowski force-pushed the feat-metrics-on-reachability-subnet branch from 90235fc to 296c10a Compare May 6, 2025 09:23
@k-wasniowski k-wasniowski changed the title feat: metrics on reachability subnet fix(plugin-meetings): metrics on reachability subnet May 8, 2025
@k-wasniowski k-wasniowski added the validated If the pull request is validated for automation. label May 8, 2025
@k-wasniowski k-wasniowski marked this pull request as ready for review May 8, 2025 12:08
@k-wasniowski k-wasniowski requested review from a team as code owners May 8, 2025 12:08
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 6

♻️ Duplicate comments (2)
packages/@webex/plugin-meetings/src/reachability/clusterReachability.ts (2)

365-375: Consider browser compatibility with URL extraction

There's a browser compatibility concern with accessing the url property on ICE candidates.

According to the previous comments, the url property is only available in Chrome (possibly Edge/Opera too). Consider adding a fallback mechanism for other browsers or confirming that this meets your browser support requirements.

#!/bin/bash
# Check browser compatibility for RTCIceCandidate.url property
rg -A 5 -B 5 "browser.*compatibility|browser.*support" --type js

386-389: Consider not stopping after first result for a protocol

Early termination when protocol results are available might miss additional useful data.

Based on previous comments, there was a concern about stopping when getting the first result for a protocol. While you indicated TCP and TLS are more time-consuming than STUN, consider whether gathering additional candidates could provide more comprehensive subnet data.

#!/bin/bash
# Check if there are other places in the codebase where ice candidates continue to be collected
rg -A 5 "onicecandidate.*\{" --type js
🧹 Nitpick comments (3)
packages/@webex/plugin-meetings/src/meeting/index.ts (1)

725-725: Property type could be more precise with string | null

Since this property is initialized as null and later set to a string, consider changing its type to string | null for better type safety.

-  private mediaServerIp: string;
+  private mediaServerIp: string | null;
packages/@webex/plugin-meetings/test/unit/spec/reachability/clusterReachability.ts (1)

460-464: Improve assertion readability with sorting

For more reliable test assertions on Set data, consider sorting the array to ensure consistent order across test runs.

  assert.deepEqual(Array.from(clusterReachability.reachedSubnets), [
-    '1.2.3.4',
-    '4.3.2.1',
-    'someTurnRelayIp'
+    '1.2.3.4',
+    '4.3.2.1',
+    'someTurnRelayIp'
+  ].sort());

Alternatively, you could use a Set-specific assertion pattern to avoid order dependency:

const expected = new Set(['1.2.3.4', '4.3.2.1', 'someTurnRelayIp']);
assert.deepEqual(clusterReachability.reachedSubnets, expected);
packages/@webex/plugin-meetings/src/reachability/clusterReachability.ts (1)

369-369: Consider using proper type checking instead of type assertion

The as any type assertion bypasses TypeScript's type checking. Consider using proper type checking instead.

-          const match = (e.candidate as any).url.match(regex);
+          // Check if url property exists before accessing
+          const candidateUrl = 'url' in e.candidate ? (e.candidate as any).url : undefined;
+          const match = candidateUrl ? candidateUrl.match(regex) : null;
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f11ee15 and 29d89f0.

📒 Files selected for processing (7)
  • packages/@webex/plugin-meetings/src/meeting/index.ts (8 hunks)
  • packages/@webex/plugin-meetings/src/meetings/util.ts (1 hunks)
  • packages/@webex/plugin-meetings/src/reachability/clusterReachability.ts (4 hunks)
  • packages/@webex/plugin-meetings/src/reachability/index.ts (1 hunks)
  • packages/@webex/plugin-meetings/test/unit/spec/meeting/index.js (16 hunks)
  • packages/@webex/plugin-meetings/test/unit/spec/reachability/clusterReachability.ts (1 hunks)
  • packages/@webex/plugin-meetings/test/unit/spec/reachability/index.ts (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
packages/@webex/plugin-meetings/src/meeting/index.ts (1)
packages/@webex/plugin-meetings/src/reachability/index.ts (1)
  • isSubnetReachable (148-184)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Build Packages
  • GitHub Check: AWS Amplify Console Web Preview
🔇 Additional comments (27)
packages/@webex/plugin-meetings/test/unit/spec/reachability/index.ts (1)

2689-2719: Well-structured tests for the new isSubnetReachable method.

The tests effectively verify the subnet matching logic by mocking the necessary data and asserting expected behavior for both positive and negative cases.

packages/@webex/plugin-meetings/src/meeting/index.ts (5)

2353-2371: LGTM: Media server IP extraction from SDP for metrics

This code properly extracts the media server IP address from the SDP for multistream meetings, which will be used for subnet reachability metrics reporting.


7774-7777: Integration with reachability subsystem for metrics

Good integration with the reachability subsystem to check if the media server's subnet was previously reachable. This information will be valuable for diagnosing connection issues.


7788-7788: LGTM: Including subnet reachability in success metrics

Including the subnet reachability status in success metrics will help correlate successful connections with network reachability.


7818-7821: LGTM: Including subnet reachability in failure metrics

Including the subnet reachability status in failure metrics will help identify if connection failures are related to network subnet reachability issues.


1610-1610: LGTM: Initializing mediaServerIp in constructor

The mediaServerIp property is correctly initialized as null in the constructor.

packages/@webex/plugin-meetings/test/unit/spec/meeting/index.js (16)

253-256: LGTM: Good test coverage for new reachability feature

The addition of the isSubnetReachable stub in the reachability mock is consistent with the PR objective of adding metrics for server subnet reachability. This ensures the new functionality is properly stubbed in tests.


2123-2126: Consistent mocking of new reachability method

The stub implementation for isSubnetReachable matches other test setup patterns in this file and ensures tests have coverage for the new subnet reachability functionality.


2179-2182: Successfully integrating subnet reachability in metrics assertions

The addition of isSubnetReachable: true to the metrics object correctly validates that the subnet reachability information is being included in metrics submissions.


2226-2229: Good coverage of connection state metrics

The inclusion of isSubnetReachable status in the connection state metrics provides valuable diagnostic information for network troubleshooting, which aligns with the PR objectives.


2241-2244: Consistent mocking of subnet reachability

Proper stubbing of the isSubnetReachable method ensures test consistency for scenarios involving media connection failures.


2292-2295: Validating metrics payload structure

Inclusion of isSubnetReachable status in assertions ensures the property is correctly included in metrics submissions during failure scenarios.


2350-2353: Comprehensive ICE connection state testing

The addition of subnet reachability status enriches the connection state metrics, providing better visibility into media connection issues.


2408-2411: Thorough test coverage for connection scenarios

Consistent inclusion of subnet reachability in metrics validation ensures comprehensive test coverage across different connection states.


2746-2749: Good setup for ICE failure scenarios

Proper stubbing of isSubnetReachable for testing ICE failure scenarios ensures that subnet reachability information is available during error handling flows.


2926-2929: Comprehensive metrics validation

The test properly validates that subnet reachability data is included in metrics submissions during network connection scenarios.


2957-2960: Consistent test patterns across error scenarios

The addition of isSubnetReachable stub is consistent with other reachability mocks in the test file, ensuring comprehensive test coverage.


3125-3128: Validating metrics during TURN discovery

Including subnet reachability status in TURN discovery metrics provides valuable network diagnostics for troubleshooting connectivity issues.


3254-3257: Thorough mock setup for ICE candidate errors

The isSubnetReachable stub is properly added to the reachability mock object, ensuring consistent test behavior for ICE candidate error scenarios.


3282-3285: Comprehensive validation of ICE error metrics

The test properly validates that the subnet reachability status is included in metrics submissions alongside ICE candidate error information.


3345-3348: Thorough connection state metrics testing

Inclusion of subnet reachability status in the metrics assertions ensures proper validation of the metrics structure during ICE connection state transitions.


3407-3410: Complete ICE error metrics validation

The test properly validates that subnet reachability information is included alongside ICE error metrics, providing comprehensive test coverage for the new feature.

packages/@webex/plugin-meetings/src/reachability/clusterReachability.ts (5)

52-52: LGTM: Addition of reachedSubnets property

This new Set will efficiently track unique server subnet IP addresses reached during ICE candidate gathering.


268-276: LGTM: Added serverIp parameter to saveResult method

The method signature is appropriately extended to accept and process server IP addresses.


304-307: LGTM: Logic to store reached server IPs

This implementation properly adds server IPs to the reachedSubnets set when provided.


376-376: LGTM: Saving server IP for srflx candidates

Properly passing the extracted server IP to the saveResult method.


383-383: LGTM: Saving server IP for relay candidates

Correctly passing the candidate's address as the server IP for relay candidates.

@k-wasniowski k-wasniowski requested a review from chrisadubois May 9, 2025 14:20
Copy link
Collaborator

@chrisadubois chrisadubois left a comment

Choose a reason for hiding this comment

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

I do not fully understand everythiung in this PR and did not validate it with a "liar" subnet but I get what is happening here, and the code appears safe. We could prioritize getting this in quickly on monday for a prod deploy cc @Coread @marcin-bazyl

Comment on lines +356 to +362
if (match) {
// eslint-disable-next-line prefer-destructuring
serverIp = match[1];
}
}

this.saveResult('udp', latencyInMilliseconds, e.candidate.address, serverIp);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion: use ternary operator

Suggested change
if (match) {
// eslint-disable-next-line prefer-destructuring
serverIp = match[1];
}
}
this.saveResult('udp', latencyInMilliseconds, e.candidate.address, serverIp);
const match = (e.candidate as any).url.match(regex);
match && ([, serverIp] = match);
this.saveResult('udp', latencyInMilliseconds, e.candidate.address, serverIp);

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure if this line is good readable.. match && ([, serverIp] = match);

Comment on lines 165 to 178
for (let i = 0; i < reachedSubnetsArray.length; i += 1) {
const subnet = reachedSubnetsArray[i];
const reachedSubnetFirstOctet = subnet.split('.')[0];

if (subnetFirstOctet === reachedSubnetFirstOctet) {
acc.add(cluster.name);
}

logMessage += `${subnet}`;
if (i < reachedSubnetsArray.length - 1) {
logMessage += ',';
}
}
logMessage += `]`;
Copy link
Contributor

Choose a reason for hiding this comment

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

(1)
Suggestion:
you can use arrow function here

const logMessage = reachedSubnetsArray
  .map((subnet) => {
    const reachedSubnetFirstOctet = subnet.split('.')[0];
    if (subnetFirstOctet === reachedSubnetFirstOctet) {
      acc.add(cluster.name);
    }
    return subnet;
  })
  .join(',');

}
logMessage += `]`;

LoggerProxy.logger.info(logMessage);
Copy link
Contributor

Choose a reason for hiding this comment

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

(2) and then use it here:

Suggested change
LoggerProxy.logger.info(logMessage);
LoggerProxy.logger.info(
`Reachability:index#isSubnetReachable --> Cluster ${cluster.name} reached [${logMessage}]`
);

@k-wasniowski k-wasniowski merged commit 40b181c into webex:next May 12, 2025
13 checks passed
@k-wasniowski k-wasniowski deleted the feat-metrics-on-reachability-subnet branch May 12, 2025 14:00
@coderabbitai coderabbitai bot mentioned this pull request Jun 27, 2025
23 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

validated If the pull request is validated for automation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants