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

(SPM) Add span kind selector #2012

Merged
merged 13 commits into from
Dec 4, 2023

Conversation

albertteoh
Copy link
Contributor

@albertteoh albertteoh commented Dec 2, 2023

Which problem is this PR solving?

Description of the changes

  • Add a span kind filter to the Monitor tab.
  • As span kinds are an attribute of a span, much like the service name, I thought it made sense to add the dropdown filter next to the service filter.
  • I'm not a designer so open to ideas on how to make this better!

How was this change tested?

  • Manually tested as per the following screen recording.
  • Update tests.
Screen.Recording.2023-12-02.at.10.37.29.pm.mov

Checklist

Signed-off-by: albertteoh <see.kwang.teoh@gmail.com>
Signed-off-by: albertteoh <see.kwang.teoh@gmail.com>
Signed-off-by: albertteoh <see.kwang.teoh@gmail.com>
Signed-off-by: albertteoh <see.kwang.teoh@gmail.com>
Signed-off-by: albertteoh <see.kwang.teoh@gmail.com>
Signed-off-by: albertteoh <see.kwang.teoh@gmail.com>
@albertteoh albertteoh requested a review from a team as a code owner December 2, 2023 12:07
@albertteoh albertteoh requested review from jkowall and removed request for a team December 2, 2023 12:07
Copy link

codecov bot commented Dec 2, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (5855da2) 96.54% compared to head (ff1ab7b) 96.55%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2012   +/-   ##
=======================================
  Coverage   96.54%   96.55%           
=======================================
  Files         256      256           
  Lines        7613     7625   +12     
  Branches     1978     1982    +4     
=======================================
+ Hits         7350     7362   +12     
  Misses        263      263           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines +101 to +105
{ label: 'Client', value: 'client' },
{ label: 'Server', value: 'server' },
{ label: 'Internal', value: 'internal' },
{ label: 'Producer', value: 'producer' },
{ label: 'Consumer', value: 'consumer' },
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Label naming follows convention used by OpenTelemetry.

@albertteoh albertteoh added the changelog:new-feature Change that should be called out as new feature in CHANGELOG label Dec 2, 2023
@@ -287,6 +304,31 @@ export class MonitorATMServicesViewImpl extends React.PureComponent<TPropsWithIn
))}
</Field>
</Col>
<Col span={6}>
<h2 className="span-kind-selector-header">Choose kind</h2>
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<h2 className="span-kind-selector-header">Choose kind</h2>
<h2 className="span-kind-selector-header">Span Kind</h2>

Similarly, s/Choose service/Service/ in L287, using the word "choose" in the UX is redundant

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed "Choose" in: 07e3c26

}}
props={{
className: 'span-kind-selector',
defaultValue: spanKindOptions[0],
Copy link
Member

Choose a reason for hiding this comment

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

client?

Copy link
Member

Choose a reason for hiding this comment

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

also, better not to depend on the array order.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍🏼 Done in: 46989de

export type MetricsAPIQueryParams = {
quantile: number;
groupByOperation?: boolean;
endTs?: number;
lookback?: number;
step?: number;
ratePer?: number;
spanKind?: 'unspecified' | 'internal' | 'server' | 'client' | 'producer' | 'consumer';
spanKind?: spanKinds;
Copy link
Member

Choose a reason for hiding this comment

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

lots of optional fields here - are they really optional? Even if they are from the server perspective, wouldn't UI code always populate them?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmmm.. yeah, not sure why it was done that way initially; removed optionality in: ccd6cc7.

@@ -361,6 +361,7 @@ describe('mapStateToProps()', () => {
metrics: originInitialState,
services: [],
selectedService: 's1',
selectedSpanKind: 'server',
Copy link
Member

Choose a reason for hiding this comment

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

do we have behavioral tests? It would be good to have tests simulating a change in span kind

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup, I could do better with test coverage; added behavioural tests in: 62a71da.

@yurishkuro yurishkuro changed the title Add span kind selector (ATM) Add span kind selector Dec 2, 2023
Albert Teoh added 7 commits December 3, 2023 07:55
Signed-off-by: Albert Teoh <albert@packsmith.io>
Signed-off-by: Albert Teoh <albert@packsmith.io>
Signed-off-by: Albert Teoh <albert@packsmith.io>
Signed-off-by: Albert Teoh <albert@packsmith.io>
Signed-off-by: Albert Teoh <albert@packsmith.io>
Signed-off-by: Albert Teoh <albert@packsmith.io>
Signed-off-by: Albert Teoh <albert@packsmith.io>
@albertteoh albertteoh changed the title (ATM) Add span kind selector (SPM) Add span kind selector Dec 3, 2023
@albertteoh
Copy link
Contributor Author

Note that I've retitled this PR to use SPM instead of ATM because that's the acronym used in our documentation. If you're okay with that, do you think we should also do the same in our codebase?

@yurishkuro
Copy link
Member

Yes we should use the same SPM name and clean up the code

@@ -210,6 +225,7 @@ export class MonitorATMServicesViewImpl extends React.PureComponent<TPropsWithIn

if (currentService) {
this.endTime = Date.now();
store.set('lastAtmSearchSpanKind', selectedSpanKind);
Copy link
Member

Choose a reason for hiding this comment

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

When we change this to SPM, a couple more improvements:

  • use constants instead of raw strings
  • keep abbreviations in uppercase, SPM not Spm (but constants should probably all be named in uppercase)

@albertteoh albertteoh merged commit 8d132ea into jaegertracing:main Dec 4, 2023
10 checks passed
@albertteoh albertteoh deleted the add-span-kind-selector branch December 4, 2023 10:58
@albertteoh
Copy link
Contributor Author

Thanks for the review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:new-feature Change that should be called out as new feature in CHANGELOG
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Empty metrics in the monitoring tab
2 participants