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

Implemented base zPages classes and TraceZ zPage #1380

Merged
merged 41 commits into from
Jul 15, 2020

Conversation

wangty27
Copy link
Contributor

zPages are a set of in-process dynamically generated HTML pages that collect and display data from the running process. In the set, TraceZ (/tracez) is the zPage that focuses on information collected about the trace spans. In particular, the TraceZ zPage displays information on sample running spans, sample latency, and sample error spans.

This PR implemented:

  • the base classes that are needed for creating a new zPage

  • the TraceZ zPage

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jun 29, 2020

CLA Check
The committers are authorized under a signed CLA.

@codecov
Copy link

codecov bot commented Jun 29, 2020

Codecov Report

Merging #1380 into master will increase coverage by 0.06%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1380      +/-   ##
============================================
+ Coverage     91.94%   92.00%   +0.06%     
  Complexity      890      890              
============================================
  Files           114      114              
  Lines          3201     3201              
  Branches        262      262              
============================================
+ Hits           2943     2945       +2     
+ Misses          176      175       -1     
+ Partials         82       81       -1     
Impacted Files Coverage Δ Complexity Δ
...telemetry/sdk/trace/export/BatchSpanProcessor.java 95.94% <0.00%> (+1.35%) 8.00% <0.00%> (ø%)

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 0da293d...842629c. Read the comment docs.

@jkwatson
Copy link
Contributor

It looks like something went wrong with this branch, as it's got a TON of things that it shouldn't in it. Seems like you might need to rebase this and re-submit?

@jkwatson
Copy link
Contributor

ooh. maybe you got it already. sorry for the noise!

@williamhu99
Copy link
Contributor

Yep, we merged our master branch with the OT master branch and cleaned up the old files.

*
* @return a Collection of {@link io.opentelemetry.sdk.trace.ReadableSpan}.
*/
public Collection<ReadableSpan> getCompletedSpans() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Return a copy perhaps?

sdk_extensions/zpages/README.md Outdated Show resolved Hide resolved
sdk_extensions/zpages/build.gradle Outdated Show resolved Hide resolved
Map<String, TracezSpanBuckets> completedSpanCache = spanProcessor.getCompletedSpanCache();
TracezSpanBuckets buckets = completedSpanCache.get(spanName);
if (buckets == null) {
return new ArrayList<>();
Copy link
Contributor

Choose a reason for hiding this comment

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

Collections.emptyList

Copy link
Contributor

Choose a reason for hiding this comment

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

There's an error with immutability vs mutability if we revert back to Collections.emptyList. Should I change the function signature to return an immutable list?

Copy link
Contributor

Choose a reason for hiding this comment

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

If we're ok with guava, then yes. 👍

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, turns out there's another way to do it as well! You can resolve this comment along with the one below.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'll wait to resolve until it's been changed. ;)

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good. I already pushed the change, so I hope it updates in the repo soon.

Map<String, TracezSpanBuckets> completedSpanCache = spanProcessor.getCompletedSpanCache();
TracezSpanBuckets buckets = completedSpanCache.get(spanName);
if (buckets == null) {
return new ArrayList<>();
Copy link
Contributor

Choose a reason for hiding this comment

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

Collections.emptyList

Copy link
Contributor

Choose a reason for hiding this comment

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

Same response as above

@williamhu99
Copy link
Contributor

@williamhu99 Can you go through all the conversations and resolve the ones that you think have been resolved? I'll give this one last review on Monday.

I don't think I have permission to resolve comments. Let me talk to Terry.

@williamhu99
Copy link
Contributor

It doesn't seem like Terry can make me an assignee or give me permission to resolve comments. Are code owners able to do this?

@jkwatson
Copy link
Contributor

It doesn't seem like Terry can make me an assignee or give me permission to resolve comments. Are code owners able to do this?

I can resolve them for you. Just add a message to the end of each conversation you think should be resolved.

@williamhu99
Copy link
Contributor

Alright, sounds good. For the open comments right now, Terry and I plan to call and resolve them.

@wangty27
Copy link
Contributor Author

We've went through all the comments and resolved the ones that we think are resolved.

Copy link
Contributor

@anuraaga anuraaga left a comment

Choose a reason for hiding this comment

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

Minor points on the test, please take a look but otherwise looks good. Thanks a lot for the help!

@carlosalberto carlosalberto self-requested a review July 14, 2020 12:36
Copy link
Contributor

@anuraaga anuraaga left a comment

Choose a reason for hiding this comment

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

Thanks a lot for all the hard work!

import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReferenceArray;

final class SpanBucket {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd love to have unit tests on this class specifically, but that can be in a follow-up PR.

Copy link
Contributor

@jkwatson jkwatson left a comment

Choose a reason for hiding this comment

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

I have 3 follow-on requests for separate PRs after this one:

  1. Make the ZPageServer not a singleton.
  2. Add unit tests for the SpanBucket
  3. Add an index page, so you don't have to remember the /tracez url to use this feature.

@jkwatson
Copy link
Contributor

Thanks for all the hard work on this!

@jkwatson jkwatson merged commit 373fbf4 into open-telemetry:master Jul 15, 2020
@jkwatson
Copy link
Contributor

Note: follow on Issues: #1415 #1416 #1414

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.

None yet

8 participants