Skip to content

feat: adding start time to spans and trace queries#435

Merged
anandtiwary merged 9 commits intomainfrom
ENG-6146-span-trace-starttime
Jan 14, 2021
Merged

feat: adding start time to spans and trace queries#435
anandtiwary merged 9 commits intomainfrom
ENG-6146-span-trace-starttime

Conversation

@anandtiwary
Copy link
Copy Markdown
Contributor

@anandtiwary anandtiwary commented Dec 16, 2020

Description

Please include a summary of the change, motivation and context.
All spans and Traces queries may optionally use a startTime for building query time range.

Testing

Please describe the tests that you ran to verify your changes. Please summarize what did you test and what needs to be tested e.g. deployed and tested helm chart locally.

Checklist:

  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Any dependent changes have been merged and published in downstream modules

Documentation

Make sure that you have documented corresponding changes in this repository or hypertrace docs repo if required.

@anandtiwary anandtiwary requested a review from a team as a code owner December 16, 2020 21:31
Comment thread projects/common/src/utilities/coercers/date-coercer.ts
traceProperties: [],
spanProperties: this.spanSpecifications
spanProperties: this.spanSpecifications,
spansTimeRange: this.getTimeRangeOrThrow()
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Previously span time range was same as Selected time range. Keeping it the same now. Although, it is definitely incorrect. We should be able to fetch all spans here for the given trace.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ah, commented on this above - we should be able to fix this.

@anandtiwary
Copy link
Copy Markdown
Contributor Author

We have trace detail, trace waterfall, api trace detail, api trace waterfall, extended api trace and extended api trace waterfall. Phew!

@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 16, 2020

Codecov Report

Merging #435 (f798914) into main (99d3a07) will increase coverage by 0.02%.
The diff coverage is 95.18%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #435      +/-   ##
==========================================
+ Coverage   85.68%   85.70%   +0.02%     
==========================================
  Files         750      751       +1     
  Lines       15339    15393      +54     
  Branches     1816     1826      +10     
==========================================
+ Hits        13143    13193      +50     
- Misses       2165     2168       +3     
- Partials       31       32       +1     
Impacted Files Coverage Δ
...g/src/pages/trace-detail/trace-detail.dashboard.ts 100.00% <ø> (ø)
.../pages/trace-detail/trace-detail.page.component.ts 31.57% <0.00%> (-1.76%) ⬇️
...pi-trace-detail/api-trace-detail.page.component.ts 23.80% <0.00%> (-1.20%) ⬇️
...oard/data/graphql/trace/trace-data-source.model.ts 75.00% <75.00%> (-1.93%) ⬇️
.../span-detail/data/span-detail-data-source.model.ts 93.54% <90.00%> (-1.91%) ⬇️
...ects/common/src/utilities/coercers/date-coercer.ts 100.00% <100.00%> (ø)
...ing/src/pages/trace-detail/trace-detail.service.ts 97.82% <100.00%> (+0.15%) ⬆️
projects/distributed-tracing/src/public-api.ts 100.00% <100.00%> (ø)
...hql/waterfall/trace-waterfall-data-source.model.ts 96.66% <100.00%> (+0.37%) ⬆️
...trace/model/span-trace-navigation-handler.model.ts 100.00% <100.00%> (ø)
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 99d3a07...f798914. Read the comment docs.

Comment thread projects/common/src/utilities/coercers/date-coercer.ts
Comment thread projects/distributed-tracing/src/pages/trace-detail/trace-detail.service.ts Outdated
Comment thread projects/distributed-tracing/src/pages/trace-detail/trace-detail.service.ts Outdated
traceProperties: [],
spanProperties: this.spanSpecifications
spanProperties: this.spanSpecifications,
spansTimeRange: this.getTimeRangeOrThrow()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ah, commented on this above - we should be able to fix this.

export class TracingNavigationService {
public constructor(private readonly navigationService: NavigationService) {}

public navigateToTraceDetail(traceId: string, spanId?: string, startTime?: unknown): Observable<boolean> {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same comment about unknowns

@anandtiwary
Copy link
Copy Markdown
Contributor Author

updated

Comment thread projects/distributed-tracing/src/pages/trace-detail/trace-detail.service.ts Outdated
Comment thread projects/distributed-tracing/src/pages/trace-detail/trace-detail.service.ts Outdated
@github-actions

This comment has been minimized.

anandtiwary and others added 2 commits January 13, 2021 19:40
…il.service.ts

Co-authored-by: Aaron Steinfeld <45047841+aaron-steinfeld@users.noreply.github.com>
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

};
}

protected getTimeRangeOrThrow(): GraphQlTimeRange {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Should we do this SpanGraphQlQueryHandlerService as well? We are not using it at many places.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think it's worth doing, but can happen in a separate PR

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

will put up a separate PR

Comment thread projects/distributed-tracing/src/pages/trace-detail/trace-detail.service.ts Outdated
@ModelProperty({
key: 'start-time',
required: false,
type: UNKNOWN_PROPERTY.type
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why unknown?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Because i think we can't put union types in model properties. This field can be string, number or undefined

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

But why not just say number (or string)? Given that we can't be as broad as we want (the code would work with string | number), it seems better to be narrower and force the value provider to match (vs having an overly broad type where some values would result in an error)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Surely we could do that. The unknown pattern was there (may be i used it initially for a valid reason). With current design, i agree we could just force it to be of a particular type.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@anandtiwary anandtiwary merged commit 10e073a into main Jan 14, 2021
@anandtiwary anandtiwary deleted the ENG-6146-span-trace-starttime branch January 14, 2021 23:24
@github-actions
Copy link
Copy Markdown

Unit Test Results

    4 files  ±  0  231 suites  +1   12m 26s ⏱️ +39s
808 tests +10  808 ✔️ +10  0 💤 ±0  0 ❌ ±0 
812 runs  +10  812 ✔️ +10  0 💤 ±0  0 ❌ ±0 

Results for commit 10e073a. ± Comparison against base commit 99d3a07.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants