Skip to content

Commit

Permalink
Fix: get log pipelines trace parser working (#3822)
Browse files Browse the repository at this point in the history
* chore: add trace parser fields to log pipeline ProcessorData interface

* chore: update trace parsing processor form field configs

* chore: logs pipeline preview: better display of sample logs when too few logs in sample

* fix: log pipelines: get tests passing: remove name prop passed to antd input
  • Loading branch information
raj-k-singh committed Oct 29, 2023
1 parent 79aef73 commit 45ead71
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ function DescriptionTextArea({
label={<FormLabelStyle>{fieldData.fieldName}</FormLabelStyle>}
key={fieldData.id}
>
<Input.TextArea
rows={3}
name={fieldData.name}
placeholder={t(fieldData.placeholder)}
/>
<Input.TextArea rows={3} placeholder={t(fieldData.placeholder)} />
</Form.Item>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function NameInput({ fieldData }: NameInputProps): JSX.Element {
rules={formValidationRules}
name={fieldData.name}
>
<Input name={fieldData.name} placeholder={t(fieldData.placeholder)} />
<Input placeholder={t(fieldData.placeholder)} />
</Form.Item>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function NameInput({ fieldData }: NameInputProps): JSX.Element {
initialValue={fieldData.initialValue}
rules={fieldData.rules ? fieldData.rules : formValidationRules}
>
<Input placeholder={t(fieldData.placeholder)} name={fieldData.name} />
<Input placeholder={t(fieldData.placeholder)} />
</Form.Item>
</FormWrapper>
</Container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@ function ParsingRulesTextArea({
name={fieldData.name}
label={<ModalFooterTitle>{fieldData.fieldName}</ModalFooterTitle>}
>
<Input.TextArea
rows={4}
name={fieldData.name}
placeholder={t(fieldData.placeholder)}
/>
<Input.TextArea rows={4} placeholder={t(fieldData.placeholder)} />
</Form.Item>
</FormWrapper>
</Container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export type ProcessorFormField = {
id: number;
fieldName: string;
placeholder: string;
name: string;
name: string | Array<string>;
rules?: Array<{ [key: string]: boolean }>;
initialValue?: string;
};
Expand Down Expand Up @@ -152,21 +152,21 @@ export const processorFields: { [key: string]: Array<ProcessorFormField> } = {
},
{
id: 2,
fieldName: 'Trace Id Parce From',
fieldName: 'Parse Trace Id From',
placeholder: 'processor_trace_id_placeholder',
name: 'traceId',
name: ['trace_id', 'parse_from'],
},
{
id: 3,
fieldName: 'Span id Parse From',
fieldName: 'Parse Span Id From',
placeholder: 'processor_span_id_placeholder',
name: 'spanId',
name: ['span_id', 'parse_from'],
},
{
id: 4,
fieldName: 'Trace flags parse from',
fieldName: 'Parse Trace flags From',
placeholder: 'processor_trace_flags_placeholder',
name: 'traceFlags',
name: ['trace_flags', 'parse_from'],
},
],
retain: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: stretch;

box-sizing: border-box;
padding: 0.25rem 0.5rem;
}

.logs-preview-list-item {
width: 100%;
position: relative;
width: 100%;
max-height: 2rem;

display: flex;
justify-content: space-between;
Expand Down
11 changes: 11 additions & 0 deletions frontend/src/types/api/pipeline/def.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@ export interface ProcessorData {
on_error?: string;
field?: string;
value?: string;

// trace parser fields.
trace_id?: {
parse_from: string;
};
span_id?: {
parse_from: string;
};
trace_flags?: {
parse_from: string;
};
}

export interface PipelineData {
Expand Down

0 comments on commit 45ead71

Please sign in to comment.