Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions server/dashboardConfig.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const {
board,
hkubeSystemVersion,
kibanaUrl,
ELASTICSEARCH_LOGS_INDEX,
structuredPrefix,
grafanaUrl,
grafanaDashboardUrl,
Expand All @@ -18,6 +19,7 @@ const {
const buildDashboardConfig = () => ({
hkubeSystemVersion,
kibanaUrl,
ELASTICSEARCH_LOGS_INDEX,
structuredPrefix,
grafanaUrl,
grafanaDashboardUrl,
Expand Down
1 change: 1 addition & 0 deletions server/setupConfig.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const parseBool = value => {

export const hkubeSystemVersion = process.env.HKUBE_SYSTEM_VERSION;
export const kibanaUrl = process.env.KIBANA_URL;
export const ELASTICSEARCH_LOGS_INDEX = process.env.KIBANA_INDEX;
export const structuredPrefix = process.env.ELASTICSEARCH_STRUCTURED_PREFIX;
export const grafanaUrl = process.env.GRAFANA_URL;
export const grafanaDashboardUrl = process.env.GRAFANA_URL;
Expand Down
14 changes: 10 additions & 4 deletions src/Routes/Tables/Jobs/NodeLogs.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,13 @@ const NodeLogs = ({
sideCarsDetails,
}) => {
const [openPopupOverListTasks, setOpenPopupOverListTasks] = useState(false);
const { kibanaUrl, structuredPrefix } = useSelector(selectors.connection);

const {
kibanaUrl,
structuredPrefix,
ELASTICSEARCH_LOGS_INDEX: elasticsearchLogsIndexFromStore,
} = useSelector(selectors.connection);
const ELASTICSEARCH_LOGS_INDEX =
elasticsearchLogsIndexFromStore || '37127fd0-9ff3-11ea-b971-21eddb3a470d';
const [logMode, setLogMode] = useState(logModes.ALGORITHM);
const [containerNames, setContainerNames] = useState([]);
const [searchWord, setSearchWord] = useState(null);
Expand Down Expand Up @@ -169,7 +174,7 @@ const NodeLogs = ({
}, [logs.length, node]);

const linkKibana = useMemo(() => {
if (!kibanaUrl || !taskId) return '';
if (!kibanaUrl || !taskId || !ELASTICSEARCH_LOGS_INDEX) return '';

const startTime =
node.batch?.length > 0
Expand All @@ -186,7 +191,7 @@ const NodeLogs = ({
metaPath = `${structuredPrefix}.${metaPath}`;
}

return `${kibanaUrl}app/kibana#/discover?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:'${time}',to:now))&_a=(columns:!(_source),filters:!(('$state':(store:appState),meta:(alias:!n,disabled:!f,index:'37127fd0-9ff3-11ea-b971-21eddb3a470d',key:${metaPath},negate:!f,params:(query:'${cTaskId}'),type:phrase),query:(match:(${metaPath}:(query:'${cTaskId}',type:phrase))))),index:'37127fd0-9ff3-11ea-b971-21eddb3a470d',interval:auto,query:(language:lucene${
return `${kibanaUrl}app/kibana#/discover?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:'${time}',to:now))&_a=(columns:!(_source),filters:!(('$state':(store:appState),meta:(alias:!n,disabled:!f,index:'${ELASTICSEARCH_LOGS_INDEX}',key:${metaPath},negate:!f,params:(query:'${cTaskId}'),type:phrase),query:(match:(${metaPath}:(query:'${cTaskId}',type:phrase))))),index:'${ELASTICSEARCH_LOGS_INDEX}',interval:auto,query:(language:lucene${
word ? `,query:${word}` : ''
}),sort:!(!('@timestamp',desc)))`;
}, [
Expand All @@ -196,6 +201,7 @@ const NodeLogs = ({
node.startTime,
currentTask,
searchWord,
ELASTICSEARCH_LOGS_INDEX,
structuredPrefix,
]);

Expand Down
2 changes: 2 additions & 0 deletions src/actions/connection.action.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const connectionSetup = ({
boardUrl,
hkubeSystemVersion,
kibanaUrl,
ELASTICSEARCH_LOGS_INDEX,
structuredPrefix,
grafanaUrl,
grafanaDashboardUrl,
Expand All @@ -40,6 +41,7 @@ export const connectionSetup = ({
boardUrl,
hkubeSystemVersion,
kibanaUrl,
ELASTICSEARCH_LOGS_INDEX,
structuredPrefix,
grafanaUrl,
grafanaDashboardUrl,
Expand Down
1 change: 1 addition & 0 deletions src/reducers/connection.reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const initialState = {
boardUrl: null,
hkubeSystemVersion: null,
kibanaUrl: null,
ELASTICSEARCH_LOGS_INDEX: null,
structuredPrefix: null,
grafanaUrl: null,
grafanaDashboardUrl: null,
Expand Down
Loading