Skip to content

Commit

Permalink
Enable search bar/timepicker for logs only services (#198296)
Browse files Browse the repository at this point in the history
## Summary

Enables logs only Services to have a timepicker in the logs tab.

![Screenshot 2024-10-31
181045](https://github.com/user-attachments/assets/0026af42-313c-4aa5-82b3-5f726d3e52d0)

### How to test

- Use `node scripts/synthtrace traces_logs_entities.ts --clean --live`
- Navigate to `synth-go-logs` service, go to logs tab
- Timepicker should be visible and work to filter available logs

Closes #197604

Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
Bluefinger and elasticmachine authored Nov 4, 2024
1 parent 867b05e commit 12dc826
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import { EuiFlexGroup, EuiFlexItem, EuiLoadingLogo, EuiSpacer, EuiTitle } from '@elastic/eui';
import React from 'react';
import { useHistory, useLocation } from 'react-router-dom';
import { isLogsOnlySignal } from '../../../../utils/get_signal_type';
import { isMobileAgentName } from '../../../../../common/agent_name';
import { ApmServiceContextProvider } from '../../../../context/apm_service/apm_service_context';
import { useApmServiceContext } from '../../../../context/apm_service/use_apm_service_context';
Expand Down Expand Up @@ -55,7 +54,7 @@ function TemplateWithContext({ title, children, selectedTab, searchBarOptions }:

const tabs = useTabs({ selectedTab });

const { agentName, serviceAgentStatus, serviceEntitySummary } = useApmServiceContext();
const { agentName, serviceAgentStatus } = useApmServiceContext();

const isPendingServiceAgent = !agentName && isPending(serviceAgentStatus);

Expand All @@ -76,9 +75,6 @@ function TemplateWithContext({ title, children, selectedTab, searchBarOptions }:
});
}

const hasLogsOnlySignal =
serviceEntitySummary?.dataStreamTypes && isLogsOnlySignal(serviceEntitySummary.dataStreamTypes);

return (
<ApmMainTemplate
pageHeader={{
Expand Down Expand Up @@ -119,7 +115,7 @@ function TemplateWithContext({ title, children, selectedTab, searchBarOptions }:
</EuiFlexGroup>
) : (
<>
{!hasLogsOnlySignal && <SearchBar {...searchBarOptions} />}
<SearchBar {...searchBarOptions} />
<ServiceAnomalyTimeseriesContextProvider>
{children}
</ServiceAnomalyTimeseriesContextProvider>
Expand Down

0 comments on commit 12dc826

Please sign in to comment.