Skip to content

Zpages example#16

Open
kmanghat wants to merge 52 commits into
data-aggregator-modificationsfrom
zpages-example
Open

Zpages example#16
kmanghat wants to merge 52 commits into
data-aggregator-modificationsfrom
zpages-example

Conversation

@kmanghat
Copy link
Copy Markdown
Owner

No description provided.

jajanet and others added 30 commits July 27, 2020 23:13
@kmanghat kmanghat requested review from jajanet and liadavid July 31, 2020 19:02
Copy link
Copy Markdown
Collaborator

@jajanet jajanet left a comment

Choose a reason for hiding this comment

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

Tiny additions/clarifications

Comment thread examples/zpages/zpages_example.cc Outdated
Comment on lines +29 to +31
// Change the name of the running span and end it
running_span->UpdateName("examplespan2");
running_span->End();
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What's the purpose of changing a span name, specifically for demonstrating the zPages interface?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

I just want to show that while a span is running the name change does not reflect in zPages only after completion does it show up.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This could be confusing for the user and not look simple, since I don't imagine users having practical reasons for doing this. The name change will also be instantaneous so users will likely not notice the it, and seeing the code will be confusing.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

I will put a comment in the code

auto running_span2 = tracer->StartSpan("examplespan2");

// Create a completed span every second till user stops the loop
std::cout << "Presss CTRL+C to stop...\n";
Copy link
Copy Markdown
Collaborator

@jajanet jajanet Aug 3, 2020

Choose a reason for hiding this comment

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

Maybe add to the cout statement that a span is generated every second here would be a good idea? Also, directing the user to the right host:post url could be beneficial.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

I did add a comment right at the top with the url.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Yes, I mean in the cout statement could be also a good place maybe?

Comment thread examples/zpages/zpages_example.cc Outdated
// Create a span of each type(running, completed and error)
auto running_span = tracer->StartSpan("examplespan");
tracer->StartSpan("examplespan")->End();
tracer->StartSpan("examplespan")->SetStatus(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do you think it would be a good idea to demonstrate adding attributes and events to spans, since zPages currently/will show these too?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

I think it's fine for now just to have a basic example. In the app if the user wants he can add attributes.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I see users adding attributes is standard in these OC/OT apps, and seeing how it's rendered in zPages would be a key way to demonstrate how both of those work while still being basic. I imagine only an additional couple lines max would be needed.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

I added attributes and it shows up but events I don't think is sent down to the span data did you check this?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Yep, it's not implemented because events (which now have their own attrtibutes and links) are relatively new. Showing events is under stretch goals on the TODO doc, but could be added. Sergey also said it was fine to leave out for now

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Ok I left it out I added attributes and few more output statements to make things more clear

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.

7 participants