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

Support upload trace in Zipkin Lens UI #2447

Merged
merged 11 commits into from
Mar 21, 2019

Conversation

tacigar
Copy link
Member

@tacigar tacigar commented Mar 18, 2019

Related: #2350
History: #2424

@tacigar tacigar changed the title Support upload trace in Zipkin Lens UI [WIP] Support upload trace in Zipkin Lens UI Mar 18, 2019
@tacigar
Copy link
Member Author

tacigar commented Mar 18, 2019

Oh, I forgot to remove traceId component from search bar...

@tacigar
Copy link
Member Author

tacigar commented Mar 18, 2019

Removed TraceId component from search bar...
Please refer #2368 🙇

@tacigar tacigar changed the title [WIP] Support upload trace in Zipkin Lens UI Support upload trace in Zipkin Lens UI Mar 18, 2019
@tacigar tacigar added enhancement ui Zipkin UI labels Mar 18, 2019
@tacigar
Copy link
Member Author

tacigar commented Mar 18, 2019

Search by trace ID
traceId

@tacigar
Copy link
Member Author

tacigar commented Mar 18, 2019

Upload Trace JSON
fromJson

@tacigar
Copy link
Member Author

tacigar commented Mar 18, 2019

Current component architecture is a bit complex.
I drew the graph.

components

@codefromthecrypt
Copy link
Member

thanks! please add the "how it works" image to the README at the bottom under a markdown section named design or a separate DESIGN.md

Copy link
Member

@codefromthecrypt codefromthecrypt left a comment

Choose a reason for hiding this comment

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

Looks good. I like the design and I feel this maximizes the UI functionality without clutter.

one small note about error handling.

pathname: '/zipkin/traceViewer',
});
} catch (error) {
// Do nothing
Copy link
Member

Choose a reason for hiding this comment

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

maybe alert the json is malformed? I assume this catch will result in someone uploading an incorrect file (ex just one span) and getting no feedback about it. correct?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes.
Do you think that it is better to display the alert dialog?

Copy link
Member

Choose a reason for hiding this comment

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

old UI did something like this..

Screen Shot 2019-03-19 at 9 25 51 AM

Copy link
Member Author

Choose a reason for hiding this comment

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

OK, Thank you.
I'll do so

@codefromthecrypt
Copy link
Member

note: the view trace screen blows up (white screen) if using v1 json

TypeError: "e is undefined"

    getServiceNameColor http://localhost:9411/zipkin/app-d005bdc780c99e8fec7a.min.js:12 value http://localhost:9411/zipkin/app-d005bdc780c99e8fec7a.min.js:88 value http://localhost:9411/zipkin/app-d005bdc780c99e8fec7a.min.js:88 

In the old uploadTrace.js we had something like this. If you import it, please also import the unit tests.

export function ensureV2(trace) {
  if (!Array.isArray(trace) || trace.length === 0) {
    throw new Error('input is not a list');
  }
  const first = trace[0];
  if (!first.traceId || !first.id) {
    throw new Error('List<Span> implies at least traceId and id fields');
  }
  if (first.binaryAnnotations || (!first.localEndpoint && !first.remoteEndpoint && !first.tags)) {
    throw new Error(
      'v1 format is not supported. For help, contact https://gitter.im/openzipkin/zipkin');
  }
}

@codefromthecrypt
Copy link
Member

Looks good besides the blowup. I tested uploading a v2 json and also get trace by ID

@tacigar
Copy link
Member Author

tacigar commented Mar 19, 2019

note: the view trace screen blows up (white screen) if using v1 json

TypeError: "e is undefined"

    getServiceNameColor http://localhost:9411/zipkin/app-d005bdc780c99e8fec7a.min.js:12 value http://localhost:9411/zipkin/app-d005bdc780c99e8fec7a.min.js:88 value http://localhost:9411/zipkin/app-d005bdc780c99e8fec7a.min.js:88 

In the old uploadTrace.js we had something like this. If you import it, please also import the unit tests.

export function ensureV2(trace) {
  if (!Array.isArray(trace) || trace.length === 0) {
    throw new Error('input is not a list');
  }
  const first = trace[0];
  if (!first.traceId || !first.id) {
    throw new Error('List<Span> implies at least traceId and id fields');
  }
  if (first.binaryAnnotations || (!first.localEndpoint && !first.remoteEndpoint && !first.tags)) {
    throw new Error(
      'v1 format is not supported. For help, contact https://gitter.im/openzipkin/zipkin');
  }
}

I see!
I'll do so

@tacigar
Copy link
Member Author

tacigar commented Mar 19, 2019

If uploaded file is not JSON...

not-json

If v1 format file is uploaded...

v1-trace

@codefromthecrypt
Copy link
Member

goodie!

@codefromthecrypt codefromthecrypt merged commit 4469655 into openzipkin:master Mar 21, 2019
@shakuzen
Copy link
Member

Great work, @tacigar!

@tacigar tacigar deleted the upload-json-dropdown branch August 3, 2019 16:39
abesto pushed a commit to abesto/zipkin that referenced this pull request Sep 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants