Skip to content
This repository was archived by the owner on Apr 11, 2023. It is now read-only.

Kiali 1906 Jaeger Integration#965

Merged
lucasponce merged 2 commits intokiali:masterfrom
aljesusg:kiali_1906
Feb 19, 2019
Merged

Kiali 1906 Jaeger Integration#965
lucasponce merged 2 commits intokiali:masterfrom
aljesusg:kiali_1906

Conversation

@aljesusg
Copy link
Contributor

@aljesusg aljesusg commented Jan 28, 2019

Jaeger Integration

Require: kiali/kiali#748
This PR add the feature to get the errorTraces of a service

Issue reference

KIALI-1906

Tasks

  • Add logfmt library require for search traces by tags
  • Created actions in Redux
  • Jaeger Toolbar
    • Namespace Selector
    • Service Selector
    • Tags Control
    • LookBack Control
    • RightToolbar
    • Durations and custom range
  • Service detail view Traces tab
    • Remove tab if jaeger is not configured
    • Traces container to show errorTraces by default
  • Distributed tracing link now show the jaeger Toolbar with the embedded component
  • Tests:
    • Jaeger Toolbar Component
      • Namespace Selector
      • Service Selector
      • Tags Control
      • LookBack Control
      • RightToolbar
      • Durations and custom range
    • Redux
      • Jaeger Actions
      • Jaeger Thunk Actions to create the url to search
      • jaeger Reducers

Screenshot

When jaeger is not configured

without_jaeger_url

@aljesusg aljesusg added the do not merge A PR is not ready to merge label Jan 28, 2019
@aljesusg aljesusg changed the title [WiP] Kiali 1906 [WiP] Kiali 1906 Jaeger Integration Jan 28, 2019
@aljesusg aljesusg changed the title [WiP] Kiali 1906 Jaeger Integration Kiali 1906 Jaeger Integration Jan 30, 2019
@aljesusg aljesusg force-pushed the kiali_1906 branch 2 times, most recently from 986c336 to 33ff814 Compare January 30, 2019 09:00
@aljesusg
Copy link
Contributor Author

@jotak @xeviknal @lucasponce this is ready, there are so tests this is why we have 6000+ sorry :(

@aljesusg aljesusg removed the do not merge A PR is not ready to merge label Jan 30, 2019
"js-yaml": "3.12.0",
"json-beautify": "1.0.1",
"lodash": "4.17.11",
"logfmt": "^1.2.1",
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you provide some information on how and why this library is used? If I understand correctly it's also used in jaeger, but I'm not sure if we really need it, what I can see is that searchOptions.tags is expected to be a string in "logfmt" format and then is converted to plain json string to pass to jaeger, but what I fail to see is where these tags come from and if we can avoid having them in that format in the first place.

Also, I think you should remove the caret in lib version, as we don't use it in general.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

logfmt is used in src/actions/JaegerThunkActions.ts

Copy link
Contributor

Choose a reason for hiding this comment

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

@aljesusg can you also fix that in your new PR? (the caret version)

}
};

export const JAEGER_QUERY = () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure if ALL_CAPS is wanted here ... @mtho11 I think you provided some naming guidelines but I can't retrieve the mail / source , what do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if we don't want ALL_CAPS in JAEGER_QUERY we should change ICONS too

Copy link
Contributor

Choose a reason for hiding this comment

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

So, icons was changed, this should be camel case too

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me fix that in #1008

};

export const JAEGER_QUERY = () => {
return deepFreeze(jaegerQuery) as typeof jaegerQuery;
Copy link
Contributor

Choose a reason for hiding this comment

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

By the way I'm not sure this has to be a function, I would imagine that deepFreeze has to be called only once and then provide the same immutable constant, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes I followed

export const config = () => {
return deepFreeze(conf) as typeof conf;
};

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah, not sure why config is like that, too.

}

export class LookBack extends React.PureComponent<LookBackProps, {}> {
lookBackOptions = {
Copy link
Contributor

Choose a reason for hiding this comment

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

The labels conventions here differ with what we have in similar dropdowns (it's fine IMO to have different values, but the names should be consistent) See in Config.ts : we capitalize only the first word ("Last 5 min" , "Last hour" ...). Also we have "Last day" instead of "Last 24 hours".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I set the same value that in Jaeger UI Toolbar, I don't see any problem to format like the others dropdowns

Copy link
Contributor

Choose a reason for hiding this comment

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

Why this wasn't done before merge?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me fix that in #1008

<Card>
<Card.Title>
Values should be in the{' '}
<a href="https://brandur.org/logfmt" target="_blank">
Copy link
Contributor

Choose a reason for hiding this comment

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

we should add rel="noopener noreferrer" to any link leading to third-parties, it prevents potential undesired data leak . See https://www.jitbit.com/alexblog/256-targetblank---the-most-underestimated-vulnerability-ever/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, I didn't know. thanks

Copy link
Contributor

Choose a reason for hiding this comment

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

same here, why isn't it done?

@@ -0,0 +1,181 @@
import * as React from 'react';
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason to name that file index.tsx instead of JaegerToolbar.tsx ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To make the imports more cleaner

import { JaegerToolbar} from 'components/JaegerToolbar';

I saw other projects that they use this like patternfly-react. We should have these things in the Code Guidelines.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok ... I don't like it so much because I usually find a component from its file name in my IDE (I have a shortcut for that in vscode). But if it's only me, no problem you can ignore.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is not problem about we can set the same name and create a index inside components with all the exports and will be the same

};

const newRequest = <P>(method: HTTP_VERBS, url: string, queryParams: any, data: any, auth?: AuthToken) =>
export const newRequest = <P>(method: HTTP_VERBS, url: string, queryParams: any, data: any, auth?: AuthToken) =>
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is it exported? I don't see it used in a new place other than Api.ts

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you are right, I was testing query the jaeger api to get errorTraces by the browser and I forgot remove it

Copy link
Contributor

Choose a reason for hiding this comment

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

still exported...

Copy link
Contributor

@jotak jotak left a comment

Choose a reason for hiding this comment

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

Huge and good work! Some comments after code review, I haven't tested locally yet.

mapStateToProps,
mapDispatchToProps
)(LookBack);

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 example here @jotak

What do you think about this @mtho11 ? I saw other components like https://github.com/kiali/kiali-ui/blob/3ec7c4d7048227e54d6523358bbc8888f86fca1e/src/components/GraphFilter/GraphFilter.tsx where we set mapStateToProps & mapDispatchToProps in the same file instead create a new file in /containers.

I think that could be cleaner if we set this in the same file, the developer can check this props in teh same file without having to go to containers folder and we would have fewer files

Copy link
Contributor

Choose a reason for hiding this comment

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

+1

@hhovsepy
Copy link
Contributor

hhovsepy commented Feb 1, 2019

Error loading graph, no logs in kiali side:
screenshot from 2019-02-01 10-53-13

@aljesusg aljesusg added the do not merge A PR is not ready to merge label Feb 4, 2019
@lucasponce
Copy link
Contributor

Probably good to rebase, I've got this error trying to test it:
image

@lucasponce
Copy link
Contributor

Another issue: tab title show some errors but tab looks empty
image

@aljesusg
Copy link
Contributor Author

aljesusg commented Feb 6, 2019

I'll ping you when this is ready, actually is looking for service.namespace and this is not working with tha TRACING bug

@aljesusg
Copy link
Contributor Author

aljesusg commented Feb 6, 2019

Another issue: tab title show some errors but tab looks empty
image

If you inspect the code you will see the iframe with the service value to productpage.bookinfo if you change the bookinfo to default you will see the traces, this is related with the bug @lucasponce I am thinking about how to fix this in the frontend side. On the other hand I saw that we should change the breadcumb name to traces too

@aljesusg
Copy link
Contributor Author

@lucasponce @hhovsepy @jotak Can you verify and check this?

@lucasponce lucasponce removed the do not merge A PR is not ready to merge label Feb 19, 2019
Copy link
Contributor

@lucasponce lucasponce left a comment

Choose a reason for hiding this comment

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

LGTM
Agreement to consolidate this work and add modifications in following PRs.

@lucasponce lucasponce merged commit 31df0cc into kiali:master Feb 19, 2019
@aljesusg aljesusg deleted the kiali_1906 branch September 9, 2019 08:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants