mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-04 03:50:41 +08:00
commit
3302a84ab5
@ -23,7 +23,7 @@ services:
|
||||
- '--storage.path=/data'
|
||||
|
||||
query-service:
|
||||
image: signoz/query-service:0.6.0
|
||||
image: signoz/query-service:0.6.1
|
||||
container_name: query-service
|
||||
command: ["-config=/root/config/prometheus.yml"]
|
||||
volumes:
|
||||
@ -40,7 +40,7 @@ services:
|
||||
condition: service_healthy
|
||||
|
||||
frontend:
|
||||
image: signoz/frontend:0.6.0
|
||||
image: signoz/frontend:0.6.1
|
||||
container_name: frontend
|
||||
depends_on:
|
||||
- query-service
|
||||
|
@ -26,7 +26,7 @@ services:
|
||||
|
||||
|
||||
query-service:
|
||||
image: signoz/query-service:0.6.0
|
||||
image: signoz/query-service:0.6.1
|
||||
container_name: query-service
|
||||
command: ["-config=/root/config/prometheus.yml"]
|
||||
volumes:
|
||||
@ -43,7 +43,7 @@ services:
|
||||
condition: service_healthy
|
||||
|
||||
frontend:
|
||||
image: signoz/frontend:0.6.0
|
||||
image: signoz/frontend:0.6.1
|
||||
container_name: frontend
|
||||
depends_on:
|
||||
- query-service
|
||||
|
@ -148,7 +148,7 @@ const Graph = ({
|
||||
|
||||
useEffect(() => {
|
||||
buildChart();
|
||||
}, []);
|
||||
}, [buildChart]);
|
||||
|
||||
return (
|
||||
<div style={{ height: '85%' }}>
|
||||
|
@ -23,7 +23,7 @@ import { Widgets } from 'types/api/dashboard/getAll';
|
||||
|
||||
import Bar from './Bar';
|
||||
import FullView from './FullView';
|
||||
import { Modal, FullViewContainer } from './styles';
|
||||
import { Modal, FullViewContainer, ErrorContainer } from './styles';
|
||||
|
||||
const GridCardGraph = ({
|
||||
widget,
|
||||
@ -124,6 +124,38 @@ const GridCardGraph = ({
|
||||
[],
|
||||
);
|
||||
|
||||
const getModals = () => {
|
||||
return (
|
||||
<>
|
||||
<Modal
|
||||
destroyOnClose
|
||||
onCancel={(): void => onToggleModal(setDeletModal)}
|
||||
visible={deleteModal}
|
||||
title="Delete"
|
||||
height="10vh"
|
||||
onOk={onDeleteHandler}
|
||||
centered
|
||||
>
|
||||
<Typography>Are you sure you want to delete this widget</Typography>
|
||||
</Modal>
|
||||
|
||||
<Modal
|
||||
title="View"
|
||||
footer={[]}
|
||||
centered
|
||||
visible={modal}
|
||||
onCancel={(): void => onToggleModal(setModal)}
|
||||
width="85%"
|
||||
destroyOnClose
|
||||
>
|
||||
<FullViewContainer>
|
||||
<FullView name={name + 'expanded'} widget={widget} />
|
||||
</FullViewContainer>
|
||||
</Modal>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
const onDeleteHandler = useCallback(() => {
|
||||
deleteWidget({ widgetId: widget.id });
|
||||
onToggleModal(setDeletModal);
|
||||
@ -131,7 +163,18 @@ const GridCardGraph = ({
|
||||
}, [deleteWidget, widget, onToggleModal, isDeleted]);
|
||||
|
||||
if (state.error) {
|
||||
return <div>{state.errorMessage}</div>;
|
||||
return (
|
||||
<>
|
||||
{getModals()}
|
||||
<Bar
|
||||
onViewFullScreenHandler={(): void => onToggleModal(setModal)}
|
||||
widget={widget}
|
||||
onDeleteHandler={(): void => onToggleModal(setDeletModal)}
|
||||
/>
|
||||
|
||||
<ErrorContainer>{state.errorMessage}</ErrorContainer>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
if (state.loading === true || state.payload === undefined) {
|
||||
@ -146,31 +189,7 @@ const GridCardGraph = ({
|
||||
onDeleteHandler={(): void => onToggleModal(setDeletModal)}
|
||||
/>
|
||||
|
||||
<Modal
|
||||
destroyOnClose
|
||||
onCancel={(): void => onToggleModal(setDeletModal)}
|
||||
visible={deleteModal}
|
||||
title="Delete"
|
||||
height="10vh"
|
||||
onOk={onDeleteHandler}
|
||||
centered
|
||||
>
|
||||
<Typography>Are you sure you want to delete this widget</Typography>
|
||||
</Modal>
|
||||
|
||||
<Modal
|
||||
title="View"
|
||||
footer={[]}
|
||||
centered
|
||||
visible={modal}
|
||||
onCancel={(): void => onToggleModal(setModal)}
|
||||
width="85%"
|
||||
destroyOnClose
|
||||
>
|
||||
<FullViewContainer>
|
||||
<FullView name={name} widget={widget} />
|
||||
</FullViewContainer>
|
||||
</Modal>
|
||||
{getModals()}
|
||||
|
||||
<GridGraphComponent
|
||||
{...{
|
||||
|
@ -15,3 +15,9 @@ export const Modal = styled(ModalComponent)<Props>`
|
||||
export const FullViewContainer = styled.div`
|
||||
height: 70vh;
|
||||
`;
|
||||
|
||||
export const ErrorContainer = styled.div`
|
||||
margin-top: 2rem;
|
||||
padding-left: 2rem;
|
||||
padding-right: 2rem;
|
||||
`;
|
||||
|
@ -61,7 +61,7 @@ const GridGraph = (): JSX.Element => {
|
||||
x: (index % 2) * 6,
|
||||
Component: (): JSX.Element => (
|
||||
<Graph
|
||||
name={e.id + index}
|
||||
name={e.id + index + 'non-expanded'}
|
||||
isDeleted={isDeleted}
|
||||
widget={widgets[index]}
|
||||
/>
|
||||
|
@ -82,17 +82,19 @@ const Signup = ({ version, userpref }: SignupProps): JSX.Element => {
|
||||
|
||||
history.push(ROUTES.APPLICATION);
|
||||
} else {
|
||||
setLoading(false);
|
||||
|
||||
notification.error({
|
||||
message: 'Something went wrong',
|
||||
});
|
||||
}
|
||||
} else {
|
||||
setLoading(false);
|
||||
|
||||
notification.error({
|
||||
message: 'Something went wrong',
|
||||
});
|
||||
}
|
||||
|
||||
setLoading(false);
|
||||
} catch (error) {
|
||||
notification.error({
|
||||
message: 'Something went wrong',
|
||||
|
@ -34,8 +34,8 @@ const plugins = [
|
||||
path: resolve(__dirname, './build/css'),
|
||||
// Public path of the CSS resources. This prefix is removed from the href
|
||||
publicPath: resolve(__dirname, './public/css'),
|
||||
fonts: true
|
||||
})
|
||||
fonts: true,
|
||||
}),
|
||||
];
|
||||
|
||||
if (process.env.BUNDLE_ANALYSER === 'true') {
|
||||
@ -48,6 +48,7 @@ const config = {
|
||||
output: {
|
||||
path: resolve(__dirname, './build'),
|
||||
publicPath: '/',
|
||||
filename: '[name].[contenthash].js',
|
||||
},
|
||||
resolve: {
|
||||
extensions: ['.ts', '.tsx', '.js', '.jsx'],
|
||||
|
@ -660,7 +660,7 @@ func (r *ClickHouseReader) LoadChannel(channel *model.ChannelItem) *model.ApiErr
|
||||
return &model.ApiError{Typ: model.ErrorBadData, Err: err}
|
||||
}
|
||||
|
||||
response, err := http.Post(constants.ALERTMANAGER_API_PREFIX+"v1/receivers", "application/json", bytes.NewBuffer([]byte(channel.Data)))
|
||||
response, err := http.Post(constants.GetAlertManagerApiPrefix()+"v1/receivers", "application/json", bytes.NewBuffer([]byte(channel.Data)))
|
||||
|
||||
if err != nil {
|
||||
zap.S().Errorf("Error in getting response of API call to alertmanager/v1/receivers\n", err)
|
||||
@ -730,7 +730,7 @@ func (r *ClickHouseReader) DeleteChannel(id string) *model.ApiError {
|
||||
values := map[string]string{"name": channelToDelete.Name}
|
||||
jsonValue, _ := json.Marshal(values)
|
||||
|
||||
req, err := http.NewRequest(http.MethodDelete, constants.ALERTMANAGER_API_PREFIX+"v1/receivers", bytes.NewBuffer(jsonValue))
|
||||
req, err := http.NewRequest(http.MethodDelete, constants.GetAlertManagerApiPrefix()+"v1/receivers", bytes.NewBuffer(jsonValue))
|
||||
|
||||
if err != nil {
|
||||
zap.S().Errorf("Error in creating new delete request to alertmanager/v1/receivers\n", err)
|
||||
@ -855,7 +855,7 @@ func (r *ClickHouseReader) EditChannel(receiver *model.Receiver, id string) (*mo
|
||||
}
|
||||
}
|
||||
|
||||
req, err := http.NewRequest(http.MethodPut, constants.ALERTMANAGER_API_PREFIX+"v1/receivers", bytes.NewBuffer(receiverString))
|
||||
req, err := http.NewRequest(http.MethodPut, constants.GetAlertManagerApiPrefix()+"v1/receivers", bytes.NewBuffer(receiverString))
|
||||
|
||||
if err != nil {
|
||||
zap.S().Errorf("Error in creating new update request to alertmanager/v1/receivers\n", err)
|
||||
@ -917,7 +917,7 @@ func (r *ClickHouseReader) CreateChannel(receiver *model.Receiver) (*model.Recei
|
||||
}
|
||||
}
|
||||
|
||||
response, err := http.Post(constants.ALERTMANAGER_API_PREFIX+"v1/receivers", "application/json", bytes.NewBuffer(receiverString))
|
||||
response, err := http.Post(constants.GetAlertManagerApiPrefix()+"v1/receivers", "application/json", bytes.NewBuffer(receiverString))
|
||||
|
||||
if err != nil {
|
||||
zap.S().Errorf("Error in getting response of API call to alertmanager/v1/receivers\n", err)
|
||||
|
@ -23,7 +23,13 @@ func IsTelemetryEnabled() bool {
|
||||
const TraceTTL = "traces"
|
||||
const MetricsTTL = "metrics"
|
||||
|
||||
const ALERTMANAGER_API_PREFIX = "http://alertmanager:9093/api/"
|
||||
func GetAlertManagerApiPrefix() string {
|
||||
if os.Getenv("ALERTMANAGER_API_PREFIX") != "" {
|
||||
return os.Getenv("ALERTMANAGER_API_PREFIX")
|
||||
}
|
||||
return "http://alertmanager:9093/api/"
|
||||
}
|
||||
|
||||
const RELATIONAL_DATASOURCE_PATH = "/var/lib/signoz/signoz.db"
|
||||
|
||||
const (
|
||||
|
20
pkg/query-service/constants/constants_test.go
Normal file
20
pkg/query-service/constants/constants_test.go
Normal file
@ -0,0 +1,20 @@
|
||||
package constants
|
||||
|
||||
import (
|
||||
. "github.com/smartystreets/goconvey/convey"
|
||||
"os"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestGetAlertManagerApiPrefix(t *testing.T) {
|
||||
Convey("TestGetAlertManagerApiPrefix", t, func() {
|
||||
res := GetAlertManagerApiPrefix()
|
||||
So(res, ShouldEqual, "http://alertmanager:9093/api/")
|
||||
|
||||
Convey("WithEnvSet", func() {
|
||||
os.Setenv("ALERTMANAGER_API_PREFIX", "http://test:9093/api/")
|
||||
res = GetAlertManagerApiPrefix()
|
||||
So(res, ShouldEqual, "http://test:9093/api/")
|
||||
})
|
||||
})
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user