Skip to content

feat: fetching log records and showing log icon #817

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

Merged
merged 12 commits into from
May 6, 2021
Merged

Conversation

itssharmasandeep
Copy link
Contributor

Description

Fetching log records and showing log icon

Testing

Local testing done.

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

Example
Screenshot 2021-05-04 at 4 30 32 PM

@itssharmasandeep itssharmasandeep requested a review from a team as a code owner May 4, 2021 11:02
@codecov
Copy link

codecov bot commented May 4, 2021

Codecov Report

Merging #817 (e25a66c) into main (58e2cd8) will increase coverage by 0.00%.
The diff coverage is 88.88%.

Impacted file tree graph

@@           Coverage Diff            @@
##             main     #817    +/-   ##
========================================
  Coverage   85.44%   85.44%            
========================================
  Files         792      792            
  Lines       16212    16221     +9     
  Branches     2073     1930   -143     
========================================
+ Hits        13852    13860     +8     
  Misses       2329     2329            
- Partials       31       32     +1     
Impacted Files Coverage Δ
projects/distributed-tracing/src/public-api.ts 100.00% <ø> (ø)
...an-name/span-name-table-cell-renderer.component.ts 100.00% <ø> (ø)
...ets/waterfall/waterfall/waterfall-chart.service.ts 95.16% <ø> (ø)
...lers/traces/trace-graphql-query-handler.service.ts 95.83% <66.66%> (-1.27%) ⬇️
...hql/waterfall/trace-waterfall-data-source.model.ts 96.87% <100.00%> (+0.20%) ⬆️
...waterfall/api-trace-waterfall-data-source.model.ts 96.96% <100.00%> (+0.41%) ⬆️

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 58e2cd8...e25a66c. Read the comment docs.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@@ -12,4 +13,6 @@ export interface SpanData {
tags: Dictionary<unknown>;
requestUrl: string;
exitCallsBreakup?: Dictionary<string>;
startTime?: number;
Copy link
Contributor

Choose a reason for hiding this comment

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

Surprised startTime isn't required. Is there a reason some of these properties optional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For startTime I've fixed. logEvents can be undefined. Apart from these I do not have much idea. may be same reason for others as well.

@@ -23,6 +23,7 @@ export interface WaterfallData {
responseBody?: string;
tags: Dictionary<unknown>;
errorCount: number;
logEvents?: LogEvent[];
Copy link
Contributor

Choose a reason for hiding this comment

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

Sort of the same question. Should this be optional? I guess in this case maybe we could expect logEvents to be undefined if none are associated with the span?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, this can be the case.

Copy link
Contributor

Choose a reason for hiding this comment

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

logEvents will never return null, always an empty array - unless we're conditionally requesting it (but I'd argue in this context, we should ensure it's there for simplicity downstream).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added extra condition to handle that.
So it is not optional anymore.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@itssharmasandeep itssharmasandeep changed the base branch from feature-log-events to main May 6, 2021 12:35
@github-actions

This comment has been minimized.

arjunlalb
arjunlalb previously approved these changes May 6, 2021
Copy link
Contributor

@arjunlalb arjunlalb left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -60,6 +60,14 @@ export class TraceWaterfallDataSourceModel extends GraphQlDataSourceModel<Waterf
this.specificationBuilder.attributeSpecificationForKey('errorCount')
];

protected readonly logEventSpecifications: Specification[] = [
this.specificationBuilder.attributeSpecificationForKey('traceId'),
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: do we actually need the spanid and trace id in these? isn't it already available in the span parent?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, we don't need that actually.
thank you for pointing that out.

@@ -37,3 +38,12 @@ export interface WaterfallChartState {
children: WaterfallDataNode[];
expanded: boolean;
}

export interface LogEvent {
[key: string]: unknown;
Copy link
Contributor

Choose a reason for hiding this comment

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

what unknown fields does this have? would anything break if you removed this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually I added this as I was using this as a table row, but lately we did not use that so now removed it.
Fixed!!

@@ -23,6 +23,7 @@ export interface WaterfallData {
responseBody?: string;
tags: Dictionary<unknown>;
errorCount: number;
logEvents?: LogEvent[];
Copy link
Contributor

Choose a reason for hiding this comment

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

logEvents will never return null, always an empty array - unless we're conditionally requesting it (but I'd argue in this context, we should ensure it's there for simplicity downstream).

@@ -12,4 +13,6 @@ export interface SpanData {
tags: Dictionary<unknown>;
requestUrl: string;
exitCallsBreakup?: Dictionary<string>;
startTime: number;
Copy link
Contributor

Choose a reason for hiding this comment

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

We hold timestamps as dates generally - converting them as soon as feasible. In this PR, it looks like we're adding a few different timestamp fields - numbers in one spot, string in another. Can those be converted to dates up front?

@itssharmasandeep itssharmasandeep merged commit f776f3d into main May 6, 2021
@itssharmasandeep itssharmasandeep deleted the log-icon branch May 6, 2021 16:16
@github-actions
Copy link

github-actions bot commented May 6, 2021

Unit Test Results

    4 files  ±0  250 suites  ±0   14m 55s ⏱️ ±0s
898 tests +1  898 ✔️ +1  0 💤 ±0  0 ❌ ±0 
904 runs  +1  904 ✔️ +1  0 💤 ±0  0 ❌ ±0 

Results for commit f776f3d. ± Comparison against base commit 58e2cd8.

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.

4 participants