mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-12 00:38:59 +08:00
Fix case mismatch in static fields. (#1537)
* case mismatch fix * fix: undefined handled in flattened data
This commit is contained in:
parent
7081e4ffce
commit
ea8bd7047f
@ -15,6 +15,7 @@ import { ILogsReducer } from 'types/reducer/logs';
|
|||||||
import AddToQueryHOC from '../AddToQueryHOC';
|
import AddToQueryHOC from '../AddToQueryHOC';
|
||||||
import CopyClipboardHOC from '../CopyClipboardHOC';
|
import CopyClipboardHOC from '../CopyClipboardHOC';
|
||||||
import { Container } from './styles';
|
import { Container } from './styles';
|
||||||
|
import { isValidLogField } from './util';
|
||||||
|
|
||||||
interface LogFieldProps {
|
interface LogFieldProps {
|
||||||
fieldKey: string;
|
fieldKey: string;
|
||||||
@ -118,7 +119,7 @@ function LogItem({ logData }: LogItemProps): JSX.Element {
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
{map(selected, (field) => {
|
{map(selected, (field) => {
|
||||||
return flattenLogData[field.name] ? (
|
return isValidLogField(flattenLogData[field.name] as never) ? (
|
||||||
<LogSelectedField
|
<LogSelectedField
|
||||||
key={field.name}
|
key={field.name}
|
||||||
fieldKey={field.name}
|
fieldKey={field.name}
|
||||||
|
1
frontend/src/components/Logs/LogItem/util.ts
Normal file
1
frontend/src/components/Logs/LogItem/util.ts
Normal file
@ -0,0 +1 @@
|
|||||||
|
export const isValidLogField = (value: never): boolean => value !== undefined;
|
@ -7,6 +7,7 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"go.signoz.io/query-service/constants"
|
||||||
"go.signoz.io/query-service/model"
|
"go.signoz.io/query-service/model"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -239,8 +240,10 @@ func replaceInterestingFields(allFields *model.GetFieldsResponse, queryTokens []
|
|||||||
sqlColName := *col
|
sqlColName := *col
|
||||||
if _, ok := selectedFieldsLookup[*col]; !ok && *col != "body" {
|
if _, ok := selectedFieldsLookup[*col]; !ok && *col != "body" {
|
||||||
if field, ok := interestingFieldLookup[*col]; ok {
|
if field, ok := interestingFieldLookup[*col]; ok {
|
||||||
|
if field.Type != constants.Static {
|
||||||
sqlColName = fmt.Sprintf("%s_%s_value[indexOf(%s_%s_key, '%s')]", field.Type, strings.ToLower(field.DataType), field.Type, strings.ToLower(field.DataType), *col)
|
sqlColName = fmt.Sprintf("%s_%s_value[indexOf(%s_%s_key, '%s')]", field.Type, strings.ToLower(field.DataType), field.Type, strings.ToLower(field.DataType), *col)
|
||||||
} else if strings.Compare(strings.ToLower(*col), "fulltext") != 0 {
|
}
|
||||||
|
} else if strings.Compare(strings.ToLower(*col), "fulltext") != 0 && field.Type != constants.Static {
|
||||||
return nil, fmt.Errorf("field not found for filtering")
|
return nil, fmt.Errorf("field not found for filtering")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -430,16 +430,16 @@ type GetFieldsResponse struct {
|
|||||||
type GetLogsResponse struct {
|
type GetLogsResponse struct {
|
||||||
Timestamp uint64 `json:"timestamp" ch:"timestamp"`
|
Timestamp uint64 `json:"timestamp" ch:"timestamp"`
|
||||||
ID string `json:"id" ch:"id"`
|
ID string `json:"id" ch:"id"`
|
||||||
TraceID string `json:"traceId" ch:"trace_id"`
|
TraceID string `json:"trace_id" ch:"trace_id"`
|
||||||
SpanID string `json:"spanId" ch:"span_id"`
|
SpanID string `json:"span_id" ch:"span_id"`
|
||||||
TraceFlags uint32 `json:"traceFlags" ch:"trace_flags"`
|
TraceFlags uint32 `json:"trace_flags" ch:"trace_flags"`
|
||||||
SeverityText string `json:"severityText" ch:"severity_text"`
|
SeverityText string `json:"severity_text" ch:"severity_text"`
|
||||||
SeverityNumber uint8 `json:"severityNumber" ch:"severity_number"`
|
SeverityNumber uint8 `json:"severity_number" ch:"severity_number"`
|
||||||
Body string `json:"body" ch:"body"`
|
Body string `json:"body" ch:"body"`
|
||||||
Resources_string map[string]string `json:"resourcesString" ch:"resources_string"`
|
Resources_string map[string]string `json:"resources_string" ch:"resources_string"`
|
||||||
Attributes_string map[string]string `json:"attributesString" ch:"attributes_string"`
|
Attributes_string map[string]string `json:"attributes_string" ch:"attributes_string"`
|
||||||
Attributes_int64 map[string]int64 `json:"attributesInt" ch:"attributes_int64"`
|
Attributes_int64 map[string]int64 `json:"attributes_int" ch:"attributes_int64"`
|
||||||
Attributes_float64 map[string]float64 `json:"attributesFloat" ch:"attributes_float64"`
|
Attributes_float64 map[string]float64 `json:"attributes_float" ch:"attributes_float64"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type LogsTailClient struct {
|
type LogsTailClient struct {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user