-
Notifications
You must be signed in to change notification settings - Fork 58
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
[Backport 2.x] Traces jaeger #214
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ import { | |
handleServiceMapRequest, | ||
handleServiceViewRequest, | ||
} from '../../../../../public/components/trace_analytics/requests/services_request_handler'; | ||
import { filtersToDsl } from '../../../../../public/components/trace_analytics/components/common/helper_functions'; | ||
import { filtersToDsl, processTimeStamp } from '../../../../../public/components/trace_analytics/components/common/helper_functions'; | ||
import { ServiceMap } from '../../../../../public/components/trace_analytics/components/services'; | ||
import { ServiceObject } from '../../../../../public/components/trace_analytics/components/common/plots/service_map'; | ||
import { SpanDetailTable } from '../../../../../public/components/trace_analytics/components/traces/span_detail_table'; | ||
|
@@ -44,6 +44,7 @@ export function ServiceDetailFlyout(props: ServiceFlyoutProps) { | |
query, | ||
closeServiceFlyout, | ||
openSpanFlyout, | ||
mode, | ||
} = props; | ||
const [fields, setFields] = useState<any>({}); | ||
const [serviceMap, setServiceMap] = useState<ServiceObject>({}); | ||
|
@@ -110,16 +111,17 @@ export function ServiceDetailFlyout(props: ServiceFlyoutProps) { | |
DSL={DSL} | ||
openFlyout={openSpanFlyout} | ||
setTotal={setTotal} | ||
mode={mode} | ||
/> | ||
</> | ||
); | ||
}, [serviceName, fields, serviceMap, DSL, serviceMapIdSelected]); | ||
|
||
useEffect(() => { | ||
const serviceDSL = filtersToDsl(filters, query, startTime, endTime, 'app', appConfigs); | ||
handleServiceViewRequest(serviceName, http, serviceDSL, setFields); | ||
handleServiceMapRequest(http, serviceDSL, setServiceMap, serviceName); | ||
const spanDSL = filtersToDsl(filters, query, startTime, endTime, 'app', appConfigs); | ||
const serviceDSL = filtersToDsl(mode, filters, query, processTimeStamp(startTime, mode), processTimeStamp(endTime, mode), 'app', appConfigs); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I feel this and some other functions have too many params passed in as separate params, what we could do here is to maybe change the function definition to something like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just kept it consistent to not change too much with one PR - wondering for my own curiosity where you are coming from - is this mainly for readability/line length? What's the benefit of passing in an object with the same params vs. just passing in the params by themselves? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are references out there explaining why to not have a long parameter list but in general it helps for not only better readability/line length, but also easier scaling, and also sometimes a long param list is an indicator of not having single responsibility for a function. But sure, not need to rush into one PR. |
||
handleServiceViewRequest(serviceName, http, serviceDSL, setFields, mode); | ||
handleServiceMapRequest(http, serviceDSL, mode, setServiceMap, serviceName); | ||
const spanDSL = filtersToDsl(mode, filters, query, startTime, endTime, 'app', appConfigs); | ||
spanDSL.query.bool.must.push({ | ||
term: { | ||
serviceName, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ interface props { | |
} | ||
|
||
export const TraceBlock = ({ http, hit, logTraceId }: props) => { | ||
if (logTraceId === '' || !isValidTraceId(logTraceId)) { | ||
if ((!hit.traceID || hit.traceID.length === 0) && (logTraceId === '' || !isValidTraceId(logTraceId))){ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm wondering if it would ever hit the second part There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Regarding your first point, I think you're right - will fix. Regarding your second point I don't think so... shouldn't we assume abstraction between how data is stored? Otherwise we will be handling a lot of edge cases, as long as the UI doesn't break if its not stored in the way we expect we just don't provide the functionality. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure if I fully understand but for second part, it seems to me that if traceID is a string like |
||
return ( | ||
<> | ||
<EuiCallOut iconType="help" title="No Trace Id found in the event."> | ||
|
@@ -42,6 +42,7 @@ export const TraceBlock = ({ http, hit, logTraceId }: props) => { | |
</> | ||
); | ||
} | ||
const mode = (!hit.traceID || hit.traceID.length === 0) ? 'data_prepper' : 'jaeger' | ||
|
||
return <TraceDetailRender traceId={logTraceId} http={http} />; | ||
return <TraceDetailRender traceId={hit.traceID || logTraceId} http={http} mode={mode}/>; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: do we want to add an endpoint base variable? something like
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea - will do