diff --git a/deploy/docker-swarm/clickhouse-setup/docker-compose.yaml b/deploy/docker-swarm/clickhouse-setup/docker-compose.yaml index 49b944af3d..8806533caa 100644 --- a/deploy/docker-swarm/clickhouse-setup/docker-compose.yaml +++ b/deploy/docker-swarm/clickhouse-setup/docker-compose.yaml @@ -37,7 +37,7 @@ services: condition: on-failure query-service: - image: signoz/query-service:0.8.0 + image: signoz/query-service:0.8.1 command: ["-config=/root/config/prometheus.yml"] # ports: # - "6060:6060" # pprof port @@ -65,7 +65,7 @@ services: - clickhouse frontend: - image: signoz/frontend:0.8.0 + image: signoz/frontend:0.8.1 deploy: restart_policy: condition: on-failure @@ -78,7 +78,7 @@ services: - ../common/nginx-config.conf:/etc/nginx/conf.d/default.conf otel-collector: - image: signoz/otelcontribcol:0.43.0-0.1 + image: signoz/otelcontribcol:0.45.1-0.2 command: ["--config=/etc/otel-collector-config.yaml"] volumes: - ./otel-collector-config.yaml:/etc/otel-collector-config.yaml @@ -104,7 +104,7 @@ services: - clickhouse otel-collector-metrics: - image: signoz/otelcontribcol:0.43.0-0.1 + image: signoz/otelcontribcol:0.45.1-0.2 command: ["--config=/etc/otel-collector-metrics-config.yaml"] volumes: - ./otel-collector-metrics-config.yaml:/etc/otel-collector-metrics-config.yaml diff --git a/deploy/docker-swarm/clickhouse-setup/otel-collector-config.yaml b/deploy/docker-swarm/clickhouse-setup/otel-collector-config.yaml index 9d34907164..5f65e6eb5c 100644 --- a/deploy/docker-swarm/clickhouse-setup/otel-collector-config.yaml +++ b/deploy/docker-swarm/clickhouse-setup/otel-collector-config.yaml @@ -52,7 +52,7 @@ extensions: health_check: {} zpages: {} exporters: - clickhouse: + clickhousetraces: datasource: tcp://clickhouse:9000/?database=signoz_traces clickhousemetricswrite: endpoint: tcp://clickhouse:9000/?database=signoz_metrics @@ -66,7 +66,7 @@ service: traces: receivers: [jaeger, otlp] processors: [signozspanmetrics/prometheus, batch] - exporters: [clickhouse] + exporters: [clickhousetraces] metrics: receivers: [otlp, hostmetrics] processors: [batch] diff --git a/deploy/docker/clickhouse-setup/docker-compose.arm.yaml b/deploy/docker/clickhouse-setup/docker-compose.arm.yaml index 0cd172ceea..e4197cfbc3 100644 --- a/deploy/docker/clickhouse-setup/docker-compose.arm.yaml +++ b/deploy/docker/clickhouse-setup/docker-compose.arm.yaml @@ -37,7 +37,7 @@ services: query-service: - image: signoz/query-service:0.8.0 + image: signoz/query-service:0.8.1 container_name: query-service command: ["-config=/root/config/prometheus.yml"] # ports: @@ -64,7 +64,7 @@ services: condition: service_healthy frontend: - image: signoz/frontend:0.8.0 + image: signoz/frontend:0.8.1 container_name: frontend restart: on-failure depends_on: @@ -76,7 +76,7 @@ services: - ../common/nginx-config.conf:/etc/nginx/conf.d/default.conf otel-collector: - image: signoz/otelcontribcol:0.43.0-0.1 + image: signoz/otelcontribcol:0.45.1-0.2 command: ["--config=/etc/otel-collector-config.yaml"] volumes: - ./otel-collector-config.yaml:/etc/otel-collector-config.yaml @@ -97,7 +97,7 @@ services: condition: service_healthy otel-collector-metrics: - image: signoz/otelcontribcol:0.43.0-0.1 + image: signoz/otelcontribcol:0.45.1-0.2 command: ["--config=/etc/otel-collector-metrics-config.yaml"] volumes: - ./otel-collector-metrics-config.yaml:/etc/otel-collector-metrics-config.yaml diff --git a/deploy/docker/clickhouse-setup/docker-compose.yaml b/deploy/docker/clickhouse-setup/docker-compose.yaml index bfcace3144..e6d2de2f3c 100644 --- a/deploy/docker/clickhouse-setup/docker-compose.yaml +++ b/deploy/docker/clickhouse-setup/docker-compose.yaml @@ -36,7 +36,7 @@ services: # Notes for Maintainers/Contributors who will change Line Numbers of Frontend & Query-Section. Please Update Line Numbers in `./scripts/commentLinesForSetup.sh` & `./CONTRIBUTING.md` query-service: - image: signoz/query-service:0.8.0 + image: signoz/query-service:0.8.1 container_name: query-service command: ["-config=/root/config/prometheus.yml"] # ports: @@ -63,7 +63,7 @@ services: condition: service_healthy frontend: - image: signoz/frontend:0.8.0 + image: signoz/frontend:0.8.1 container_name: frontend restart: on-failure depends_on: @@ -75,7 +75,7 @@ services: - ../common/nginx-config.conf:/etc/nginx/conf.d/default.conf otel-collector: - image: signoz/otelcontribcol:0.43.0-0.1 + image: signoz/otelcontribcol:0.45.1-0.2 command: ["--config=/etc/otel-collector-config.yaml"] volumes: - ./otel-collector-config.yaml:/etc/otel-collector-config.yaml @@ -96,7 +96,7 @@ services: condition: service_healthy otel-collector-metrics: - image: signoz/otelcontribcol:0.43.0-0.1 + image: signoz/otelcontribcol:0.45.1-0.2 command: ["--config=/etc/otel-collector-metrics-config.yaml"] volumes: - ./otel-collector-metrics-config.yaml:/etc/otel-collector-metrics-config.yaml diff --git a/deploy/docker/clickhouse-setup/otel-collector-config.yaml b/deploy/docker/clickhouse-setup/otel-collector-config.yaml index c59a8f0e87..bcf7ce58ce 100644 --- a/deploy/docker/clickhouse-setup/otel-collector-config.yaml +++ b/deploy/docker/clickhouse-setup/otel-collector-config.yaml @@ -52,7 +52,7 @@ extensions: health_check: {} zpages: {} exporters: - clickhouse: + clickhousetraces: datasource: tcp://clickhouse:9000/?database=signoz_traces clickhousemetricswrite: endpoint: tcp://clickhouse:9000/?database=signoz_metrics @@ -66,7 +66,7 @@ service: traces: receivers: [jaeger, otlp] processors: [signozspanmetrics/prometheus, batch] - exporters: [clickhouse] + exporters: [clickhousetraces] metrics: receivers: [otlp, hostmetrics] processors: [batch] diff --git a/frontend/src/container/GridGraphLayout/GraphLayout.tsx b/frontend/src/container/GridGraphLayout/GraphLayout.tsx index 32b87ee09d..97fee8ec9d 100644 --- a/frontend/src/container/GridGraphLayout/GraphLayout.tsx +++ b/frontend/src/container/GridGraphLayout/GraphLayout.tsx @@ -29,12 +29,15 @@ function GraphLayout({ const { role } = useSelector((state) => state.app); const { isDarkMode } = useSelector((state) => state.app); - const [saveLayout] = useComponentPermission(['save_layout'], role); + const [saveLayoutPermission, addPanelPermission] = useComponentPermission( + ['save_layout', 'add_panel'], + role, + ); return ( <> - {saveLayout && ( + {saveLayoutPermission && ( )} - + {addPanelPermission && ( + + )} ( (state) => state.dashboards, ); + const { role } = useSelector((state) => state.app); + + const [saveLayoutPermission] = useComponentPermission(['save_layout'], role); const [saveLayoutState, setSaveLayoutState] = useState({ loading: false, error: false, @@ -109,31 +114,34 @@ function GridGraph(props: Props): JSX.Element { loading: true, })); - const response = await updateDashboardApi({ - data: { - title: data.title, - description: data.description, - name: data.name, - tags: data.tags, - widgets: data.widgets, - layout, - }, - uuid: selectedDashboard.uuid, - }); - if (response.statusCode === 200) { - setSaveLayoutState((state) => ({ - ...state, - error: false, - errorMessage: '', - loading: false, - })); - } else { - setSaveLayoutState((state) => ({ - ...state, - error: true, - errorMessage: response.error || 'Something went wrong', - loading: false, - })); + // Save layout only when users has the has the permission to do so. + if (saveLayoutPermission) { + const response = await updateDashboardApi({ + data: { + title: data.title, + description: data.description, + name: data.name, + tags: data.tags, + widgets: data.widgets, + layout, + }, + uuid: selectedDashboard.uuid, + }); + if (response.statusCode === 200) { + setSaveLayoutState((state) => ({ + ...state, + error: false, + errorMessage: '', + loading: false, + })); + } else { + setSaveLayoutState((state) => ({ + ...state, + error: true, + errorMessage: response.error || 'Something went wrong', + loading: false, + })); + } } } catch (error) { console.error(error); @@ -145,6 +153,7 @@ function GridGraph(props: Props): JSX.Element { data.tags, data.title, data.widgets, + saveLayoutPermission, selectedDashboard.uuid, ], ); diff --git a/frontend/src/container/SideNav/styles.ts b/frontend/src/container/SideNav/styles.ts index ae0ed0898b..688356cf7d 100644 --- a/frontend/src/container/SideNav/styles.ts +++ b/frontend/src/container/SideNav/styles.ts @@ -66,7 +66,7 @@ export const RedDot = styled.div` background: #d32029; border-radius: 50%; - margin-left: 1rem; + margin-left: 0.5rem; margin-top: 0.5rem; `; diff --git a/frontend/src/utils/permission/index.ts b/frontend/src/utils/permission/index.ts index a4fe82b395..6f12d43225 100644 --- a/frontend/src/utils/permission/index.ts +++ b/frontend/src/utils/permission/index.ts @@ -16,7 +16,8 @@ export type ComponentTypes = | 'delete_widget' | 'new_dashboard' | 'new_alert_action' - | 'edit_widget'; + | 'edit_widget' + | 'add_panel'; export const componentPermission: Record = { current_org_settings: ['ADMIN'], @@ -34,6 +35,7 @@ export const componentPermission: Record = { new_dashboard: ['ADMIN', 'EDITOR'], new_alert_action: ['ADMIN'], edit_widget: ['ADMIN', 'EDITOR'], + add_panel: ['ADMIN', 'EDITOR'], }; export const routePermission: Record = { @@ -47,7 +49,7 @@ export const routePermission: Record = { APPLICATION: ['ADMIN', 'EDITOR', 'VIEWER'], CHANNELS_EDIT: ['ADMIN'], CHANNELS_NEW: ['ADMIN'], - DASHBOARD: ['ADMIN', 'EDITOR', 'EDITOR'], + DASHBOARD: ['ADMIN', 'EDITOR', 'VIEWER'], DASHBOARD_WIDGET: ['ADMIN', 'EDITOR', 'VIEWER'], EDIT_ALERTS: ['ADMIN'], ERROR_DETAIL: ['ADMIN', 'EDITOR', 'VIEWER'], diff --git a/pkg/query-service/tests/test-deploy/docker-compose.arm.yaml b/pkg/query-service/tests/test-deploy/docker-compose.arm.yaml index 5b3bfc13a8..387daed353 100644 --- a/pkg/query-service/tests/test-deploy/docker-compose.arm.yaml +++ b/pkg/query-service/tests/test-deploy/docker-compose.arm.yaml @@ -51,7 +51,7 @@ services: condition: service_healthy otel-collector: - image: signoz/otelcontribcol:0.43.0-0.1 + image: signoz/otelcontribcol:0.45.1-0.2 command: ["--config=/etc/otel-collector-config.yaml"] volumes: - ./otel-collector-config.yaml:/etc/otel-collector-config.yaml @@ -64,7 +64,7 @@ services: condition: service_healthy otel-collector-metrics: - image: signoz/otelcontribcol:0.43.0-0.1 + image: signoz/otelcontribcol:0.45.1-0.2 command: ["--config=/etc/otel-collector-metrics-config.yaml"] volumes: - ./otel-collector-metrics-config.yaml:/etc/otel-collector-metrics-config.yaml diff --git a/pkg/query-service/tests/test-deploy/docker-compose.yaml b/pkg/query-service/tests/test-deploy/docker-compose.yaml index ddee65d432..28bfb726af 100644 --- a/pkg/query-service/tests/test-deploy/docker-compose.yaml +++ b/pkg/query-service/tests/test-deploy/docker-compose.yaml @@ -56,7 +56,7 @@ services: condition: service_healthy otel-collector: - image: signoz/otelcontribcol:0.43.0-0.1 + image: signoz/otelcontribcol:0.45.1-0.2 command: ["--config=/etc/otel-collector-config.yaml"] volumes: - ./otel-collector-config.yaml:/etc/otel-collector-config.yaml @@ -69,7 +69,7 @@ services: condition: service_healthy otel-collector-metrics: - image: signoz/otelcontribcol:0.43.0-0.1 + image: signoz/otelcontribcol:0.45.1-0.2 command: ["--config=/etc/otel-collector-metrics-config.yaml"] volumes: - ./otel-collector-metrics-config.yaml:/etc/otel-collector-metrics-config.yaml diff --git a/pkg/query-service/tests/test-deploy/otel-collector-config.yaml b/pkg/query-service/tests/test-deploy/otel-collector-config.yaml index 128d0fb6a2..d6c12ddcc1 100644 --- a/pkg/query-service/tests/test-deploy/otel-collector-config.yaml +++ b/pkg/query-service/tests/test-deploy/otel-collector-config.yaml @@ -49,7 +49,7 @@ extensions: health_check: {} zpages: {} exporters: - clickhouse: + clickhousetraces: datasource: tcp://clickhouse:9000/?database=signoz_traces clickhousemetricswrite: endpoint: tcp://clickhouse:9000/?database=signoz_metrics @@ -63,7 +63,7 @@ service: traces: receivers: [jaeger, otlp] processors: [signozspanmetrics/prometheus, batch] - exporters: [clickhouse] + exporters: [clickhousetraces] metrics: receivers: [otlp, hostmetrics] processors: [batch]