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

Traces/Services - Query optimization / UI setting / Bugfix #2310

Merged
merged 13 commits into from
Jan 17, 2025

Conversation

TackAdam
Copy link
Collaborator

@TackAdam TackAdam commented Jan 13, 2025

Description

  1. Remove the all_services aggregation field from getRelatedServiceQuery. The only purpose seemed to be in displaying the “greyed-out” connection in service map. Earlier code changes removed the full map being displayed with this grey-out functionality in preference of the “Focus on” search box being implemented. This field being presented seemed to require a 4x increase in the number of buckets.
  • Removed the shading logic from getServiceMapGraph as we no longer enter that state based on related services.
  1. Remove the traceGroupName aggregation field from getServiceNodesQuery. This appeared to be an old artifact and was not used in any visualizations.
  2. Remove the toast messages after the first check of handleServiceMapRequest as they were indicating false positives as the map took time to render.
  3. Add "TRACE_CUSTOM_MODE_DEFAULT_SETTING" option for users to enable it as the default landing page. Update the fly-out for custom source to include the option to enable this. When the mode is not presented and this setting is enabled it will direct the user to correct mode.
  4. Update the error field for custom spans under the non "traces" field. It was originally using the >0 check used for error_count but this field uses status.code which is only an error when it is equal to 2. https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#set-status
  1. Update the Services table link, and Expand view buttons to append the trace mode to allow it to be used as a favorite or shared link.
  2. Fix a bug that was causing infinite refreshes if MDS was disabled and the service page - traces link was clicked as the datasource was appended as undefined.
  3. Fix flaky cypress test in services by adding wait condition.

Before: (with all_services)

PUT _cluster/settings
{ "persistent": { "search.max_buckets": 450 } }
Before_460Buckets.mov

Required 460 buckets to avoid errors.
After: (removed all_services)

After_110Buckets.mov

Required just 110 buckets to avoid errors.

TRACE_CUSTOM_MODE_DEFAULT_SETTING:
Screenshot 2025-01-14 at 2 00 22 PM
Screenshot 2025-01-14 at 2 00 47 PM
Example usage:

CustomModeSetting.mov

Service page infinite refresh while MDS disabled bug Before:

Screen.Recording.2025-01-14.at.4.31.31.PM.mov

After (fixed):

Screen.Recording.2025-01-14.at.4.37.14.PM.mov

Issues Resolved

[List any issues this PR will resolve]

Check List

  • New functionality includes testing.
    • All tests pass, including unit test, integration test and doctest
  • New functionality has been documented.
    • New functionality has javadoc added
    • New functionality has user manual doc added
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Adam Tackett <tackadam@amazon.com>
Adam Tackett added 3 commits January 13, 2025 16:33
…ctions

Signed-off-by: Adam Tackett <tackadam@amazon.com>
Signed-off-by: Adam Tackett <tackadam@amazon.com>
Signed-off-by: Adam Tackett <tackadam@amazon.com>
@TackAdam TackAdam changed the title Traces/Services - Query optimization Traces/Services - Query optimization / UI setting Jan 14, 2025
@TackAdam TackAdam changed the title Traces/Services - Query optimization / UI setting Traces/Services - Query optimization / UI setting / Bugfix Jan 14, 2025
@TackAdam TackAdam added the bug Something isn't working label Jan 14, 2025
Adam Tackett added 4 commits January 14, 2025 15:56
Signed-off-by: Adam Tackett <tackadam@amazon.com>
…link clicked

Signed-off-by: Adam Tackett <tackadam@amazon.com>
Signed-off-by: Adam Tackett <tackadam@amazon.com>
Signed-off-by: Adam Tackett <tackadam@amazon.com>
@TackAdam TackAdam marked this pull request as ready for review January 15, 2025 18:20
Copy link
Collaborator

@RyanL1997 RyanL1997 left a comment

Choose a reason for hiding this comment

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

Hi @TackAdam , thanks for putting this together. And I just left some comments.

public/components/trace_analytics/home.tsx Outdated Show resolved Hide resolved
public/components/trace_analytics/home.tsx Outdated Show resolved Hide resolved
Signed-off-by: Adam Tackett <tackadam@amazon.com>
DSL?.query?.bool.must
.filter((must: any) => must.term?.['traceGroup'])
.map((must: any) => must.term.traceGroup) || []
const targetResource = [].concat(
Copy link
Member

Choose a reason for hiding this comment

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

this logic no longer consider traceGroup filters in DSL anymore, does it change behavior of service metrics when filtering by trace group?

seems it would always consider all targetResources instead of the subset of targetResources that belong to services with traceGroups matching the user's traceGroup filter, which should cause a difference?

I'm ok if the difference it makes is not meaningful for users, just want to check if it's what we want

Copy link
Collaborator

@RyanL1997 RyanL1997 left a comment

Choose a reason for hiding this comment

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

LGTM. Once we address @joshuali925 's comment we can proceed to merge

Adam Tackett added 3 commits January 17, 2025 10:52
Signed-off-by: Adam Tackett <tackadam@amazon.com>
Signed-off-by: Adam Tackett <tackadam@amazon.com>
prove readability, remove related servics

Signed-off-by: Adam Tackett <tackadam@amazon.com>
Copy link
Member

@joshuali925 joshuali925 left a comment

Choose a reason for hiding this comment

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

also CI has been failing?

Signed-off-by: Adam Tackett <tackadam@amazon.com>
@TackAdam
Copy link
Collaborator Author

also CI has been failing?

Added in

interface ServiceMapParams {
  map: ServiceObject;
  idSelected: 'latency' | 'error_rate' | 'throughput';
  ticks: number[];
  currService?: string;
  filterByCurrService?: boolean;
}

To clean up the code readability when removing the related service param. Had to adjust the test as well I missed in last commit. Should pass now, will wait for run to complete.

@TackAdam TackAdam merged commit 8016a73 into opensearch-project:main Jan 17, 2025
18 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jan 17, 2025
* improve service node query and related services query

Signed-off-by: Adam Tackett <tackadam@amazon.com>

* update url redirection for services for the table and expanded view actions

Signed-off-by: Adam Tackett <tackadam@amazon.com>

* remove extra toast messages from  handleServiceMapRequest

Signed-off-by: Adam Tackett <tackadam@amazon.com>

* add observability setting for enabling custom source as the default mode

Signed-off-by: Adam Tackett <tackadam@amazon.com>

* fix bug returning errors on spans that have a status.code === 1

Signed-off-by: Adam Tackett <tackadam@amazon.com>

* fix bug causing infinite refrshed if mds disabled and services trace link clicked

Signed-off-by: Adam Tackett <tackadam@amazon.com>

* add the mode param to url for services - trace redirection

Signed-off-by: Adam Tackett <tackadam@amazon.com>

* fix flaky cypress test for services

Signed-off-by: Adam Tackett <tackadam@amazon.com>

* address comments

Signed-off-by: Adam Tackett <tackadam@amazon.com>

* remove test, add comment, remove related service param

Signed-off-by: Adam Tackett <tackadam@amazon.com>

* place related services back

Signed-off-by: Adam Tackett <tackadam@amazon.com>

* add type for serviceMapParams, im
prove readability, remove related servics

Signed-off-by: Adam Tackett <tackadam@amazon.com>

* update service map test for the new type

Signed-off-by: Adam Tackett <tackadam@amazon.com>

---------

Signed-off-by: Adam Tackett <tackadam@amazon.com>
Co-authored-by: Adam Tackett <tackadam@amazon.com>
(cherry picked from commit 8016a73)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
TackAdam pushed a commit that referenced this pull request Jan 17, 2025
…2312)

* improve service node query and related services query



* update url redirection for services for the table and expanded view actions



* remove extra toast messages from  handleServiceMapRequest



* add observability setting for enabling custom source as the default mode



* fix bug returning errors on spans that have a status.code === 1



* fix bug causing infinite refrshed if mds disabled and services trace link clicked



* add the mode param to url for services - trace redirection



* fix flaky cypress test for services



* address comments



* remove test, add comment, remove related service param



* place related services back



* add type for serviceMapParams, im
prove readability, remove related servics



* update service map test for the new type



---------



(cherry picked from commit 8016a73)

Signed-off-by: Adam Tackett <tackadam@amazon.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Adam Tackett <tackadam@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x bug Something isn't working maintenance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants