Skip to content

Commit

Permalink
Merge branch 'feat/trial-end-screen-UI-fixes' of github.com:sharpshoo…
Browse files Browse the repository at this point in the history
…ter90/signoz into feat/trial-end-screen-UI-fixes
  • Loading branch information
sharpshooter90 committed Sep 19, 2024
2 parents 7a0472b + caac561 commit eee5c0c
Show file tree
Hide file tree
Showing 19 changed files with 157 additions and 28 deletions.
58 changes: 58 additions & 0 deletions .github/ISSUE_TEMPLATE/request_dashboard.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
name: Request Dashboard
about: Request a new dashboard for the SigNoz Dashboards repository
title: ''
labels: 'dashboard-template'
assignees: ''

---

## 📝 Dashboard Request Template

*Use this template to request a new dashboard for the SigNoz Dashboards repository. Please provide as much detail as possible to help us understand your needs.*

---

### 1. Dashboard Name

Name of the requested dashboard (e.g., MySQL Monitoring Dashboard):

---

### 2. Expected Dashboard Sections and Panels

#### Section Name

Brief description of the section (e.g., "Resource usage metrics for MySQL database").

#### Panel Name

Panel description (e.g., "Value-type panels displaying current CPU usage, memory usage, etc.").

- **Example:**
- **Section**: Resource Metrics
- **Panel**: CPU Usage - Displays the current CPU usage across all database instances.
- **Panel**: Memory Usage - Displays the total memory used by the MySQL process.

(Repeat this format for additional sections and panels)

---

### 3. Expected Variables

List any variables you expect to use in the dashboard (e.g., `deployment.environment`, `hostname`, etc.).

---

### 4. Additional Comments or Requirements

Any additional details or special requirements for the dashboard?

---

### 📋 Notes

Please review the [CONTRIBUTING.md](https://github.com/SigNoz/dashboards/blob/main/CONTRIBUTING.md) for guidelines on dashboard structure, naming conventions, and how to submit a pull request.

---
Thank you for your request! We will review it and provide feedback or guidance as necessary.
2 changes: 1 addition & 1 deletion frontend/public/locales/en-GB/services.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"rps_over_100": "You are sending data at more than 100 RPS, your ingestion may be rate limited. Please reach out to us via Intercom support."
"rps_over_100": "You are sending data at more than 100 RPS, your ingestion may be rate limited. Please reach out to us via Intercom support or "
}
2 changes: 1 addition & 1 deletion frontend/public/locales/en/services.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"rps_over_100": "You are sending data at more than 100 RPS, your ingestion may be rate limited. Please reach out to us via Intercom support."
"rps_over_100": "You are sending data at more than 100 RPS, your ingestion may be rate limited. Please reach out to us via Intercom support or "
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@
align-items: center;
}
}

.billing-update-note {
text-align: left;
font-size: 13px;
color: var(--bg-vanilla-200);
margin-top: 16px;
}
}

.ant-skeleton.ant-skeleton-element.ant-skeleton-active {
Expand All @@ -75,5 +82,9 @@
}
}
}

.billing-update-note {
color: var(--bg-ink-200);
}
}
}
7 changes: 6 additions & 1 deletion frontend/src/container/BillingContainer/BillingContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,12 @@ export default function BillingContainer(): JSX.Element {
const BillingUsageGraphCallback = useCallback(
() =>
!isLoading && !isFetchingBillingData ? (
<BillingUsageGraph data={apiResponse} billAmount={billAmount} />
<>
<BillingUsageGraph data={apiResponse} billAmount={billAmount} />
<div className="billing-update-note">
Note: Billing metrics are updated once every 24 hours.
</div>
</>
) : (
<Card className="empty-graph-card" bordered={false}>
<Spinner size="large" tip="Loading..." height="35vh" />
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/container/CreateAlertRule/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const logAlertDefaults: AlertDef = {
chQueries: {
A: {
name: 'A',
query: `select \ntoStartOfInterval(fromUnixTimestamp64Nano(timestamp), INTERVAL 30 MINUTE) AS interval, \ntoFloat64(count()) as value \nFROM signoz_logs.distributed_logs \nWHERE timestamp BETWEEN {{.start_timestamp_nano}} AND {{.end_timestamp_nano}} \nGROUP BY interval;\n\n-- available variables:\n-- \t{{.start_timestamp_nano}}\n-- \t{{.end_timestamp_nano}}\n\n-- required columns (or alias):\n-- \tvalue\n-- \tinterval`,
query: `select \ntoStartOfInterval(fromUnixTimestamp64Nano(timestamp), INTERVAL 30 MINUTE) AS interval, \ntoFloat64(count()) as value \nFROM signoz_logs.distributed_logs_v2 \nWHERE timestamp BETWEEN {{.start_timestamp_nano}} AND {{.end_timestamp_nano}} \nGROUP BY interval;\n\n-- available variables:\n-- \t{{.start_timestamp_nano}}\n-- \t{{.end_timestamp_nano}}\n\n-- required columns (or alias):\n-- \tvalue\n-- \tinterval`,
legend: '',
disabled: false,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ function FullView({

const [graphsVisibilityStates, setGraphsVisibilityStates] = useState<
boolean[]
>(Array(response.data?.payload.data.result.length).fill(true));
>(Array(response.data?.payload?.data?.result?.length).fill(true));

useEffect(() => {
const {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,10 @@ function ServiceMetricTable({
return (
<>
{RPS > MAX_RPS_LIMIT && (
<Flex justify="center">
<Flex justify="left">
<Typography.Title level={5} type="warning" style={{ marginTop: 0 }}>
<WarningFilled /> {getText('rps_over_100')}
<a href="mailto:[email protected]">email</a>
</Typography.Title>
</Flex>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,11 @@ function ServiceTraceTable({
return (
<>
{RPS > MAX_RPS_LIMIT && (
<Flex justify="flex-end">
<Typography.Text type="warning" style={{ marginTop: 0 }}>
<Flex justify="left">
<Typography.Title level={5} type="warning" style={{ marginTop: 0 }}>
<WarningFilled /> {getText('rps_over_100')}
</Typography.Text>
<a href="mailto:[email protected]">email</a>
</Typography.Title>
</Flex>
)}

Expand Down
6 changes: 0 additions & 6 deletions frontend/src/container/SideNav/menuItems.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { RocketOutlined } from '@ant-design/icons';
import ROUTES from 'constants/routes';
import {
AreaChart,
BarChart2,
BellDot,
BugIcon,
Expand Down Expand Up @@ -114,11 +113,6 @@ const menuItems: SidebarItem[] = [
icon: <Route size={16} />,
isBeta: true,
},
{
key: ROUTES.USAGE_EXPLORER,
label: 'Usage Explorer',
icon: <AreaChart size={16} />,
},
{
key: ROUTES.BILLING,
label: 'Billing',
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/hooks/queryBuilder/useFetchKeysAndValues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const useFetchKeysAndValues = (
const queryFiltersWithoutId = useMemo(
() => ({
...query.filters,
items: query.filters.items.map((item) => {
items: query.filters?.items?.map((item) => {
const filterWithoutId = cloneDeep(item);
unset(filterWithoutId, 'id');
return filterWithoutId;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/LogsExplorer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function LogsExplorer(): JSX.Element {
}
if (
currentQuery.builder.queryData.length === 1 &&
currentQuery.builder.queryData[0].groupBy.length > 0
currentQuery.builder.queryData?.[0]?.groupBy?.length > 0
) {
handleChangeSelectedView(SELECTED_VIEWS.QUERY_BUILDER);
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/Support/Support.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const supportChannels = [
name: 'Schedule a call',
icon: <Calendar />,
title: 'Schedule a call with the founders.',
url: 'https://calendly.com/pranay-signoz/signoz-intro-calls',
url: 'https://calendly.com/vishal-signoz/30min',
btnText: 'Schedule call',
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
font-weight: 400;
line-height: 18px;
letter-spacing: -0.005em;
&,
&:hover {
color: var(--text-vanilla-400);
}
}
&__key {
background: var(--bg-ink-400);
Expand All @@ -20,13 +24,15 @@
&__value {
background: var(--bg-slate-400);
}
color: var(--text-vanilla-400);
}

.lightMode {
.key-value-label {
border-color: var(--bg-vanilla-400);
color: var(--text-ink-400);
&__key,
&__value {
color: var(--text-ink-400);
}
&__key {
background: var(--bg-vanilla-300);
}
Expand Down
23 changes: 19 additions & 4 deletions frontend/src/periscope/components/KeyValueLabel/KeyValueLabel.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import './KeyValueLabel.styles.scss';

import { Tooltip } from 'antd';
import { useMemo } from 'react';

import TrimmedText from '../TrimmedText/TrimmedText';

Expand All @@ -15,19 +16,33 @@ export default function KeyValueLabel({
badgeValue,
maxCharacters = 20,
}: KeyValueLabelProps): JSX.Element | null {
const isUrl = useMemo(() => /^https?:\/\//.test(badgeValue), [badgeValue]);

if (!badgeKey || !badgeValue) {
return null;
}

return (
<div className="key-value-label">
<div className="key-value-label__key">
<TrimmedText text={badgeKey} maxCharacters={maxCharacters} />
</div>
<Tooltip title={badgeValue}>
<div className="key-value-label__value">
{isUrl ? (
<a
href={badgeValue}
target="_blank"
rel="noopener noreferrer"
className="key-value-label__value"
>
<TrimmedText text={badgeValue} maxCharacters={maxCharacters} />
</div>
</Tooltip>
</a>
) : (
<Tooltip title={badgeValue}>
<div className="key-value-label__value">
<TrimmedText text={badgeValue} maxCharacters={maxCharacters} />
</div>
</Tooltip>
)}
</div>
);
}
Expand Down
15 changes: 15 additions & 0 deletions pkg/query-service/app/dashboards/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ func GetDashboardsInfo(ctx context.Context) (*model.DashboardsInfo, error) {
totalDashboardsWithPanelAndName := 0
var dashboardNames []string
count := 0
logChQueriesCount := 0
for _, dashboard := range dashboardsData {
if isDashboardWithPanelAndName(dashboard.Data) {
totalDashboardsWithPanelAndName = totalDashboardsWithPanelAndName + 1
Expand All @@ -468,12 +469,16 @@ func GetDashboardsInfo(ctx context.Context) (*model.DashboardsInfo, error) {
if isDashboardWithTSV2(dashboard.Data) {
count = count + 1
}
if isDashboardWithLogsClickhouseQuery(dashboard.Data) {
logChQueriesCount = logChQueriesCount + 1
}
}

dashboardsInfo.DashboardNames = dashboardNames
dashboardsInfo.TotalDashboards = len(dashboardsData)
dashboardsInfo.TotalDashboardsWithPanelAndName = totalDashboardsWithPanelAndName
dashboardsInfo.QueriesWithTSV2 = count
dashboardsInfo.DashboardsWithLogsChQuery = logChQueriesCount
return &dashboardsInfo, nil
}

Expand All @@ -485,6 +490,16 @@ func isDashboardWithTSV2(data map[string]interface{}) bool {
return strings.Contains(string(jsonData), "time_series_v2")
}

func isDashboardWithLogsClickhouseQuery(data map[string]interface{}) bool {
jsonData, err := json.Marshal(data)
if err != nil {
return false
}
result := strings.Contains(string(jsonData), "signoz_logs.distributed_logs ") ||
strings.Contains(string(jsonData), "signoz_logs.logs ")
return result
}

func isDashboardWithPanelAndName(data map[string]interface{}) bool {
isDashboardName := false
isDashboardWithPanelAndName := false
Expand Down
20 changes: 17 additions & 3 deletions pkg/query-service/app/logs/v4/query_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,23 @@ func getSelectLabels(aggregatorOperator v3.AggregateOperator, groupBy []v3.Attri

func getExistsNexistsFilter(op v3.FilterOperator, item v3.FilterItem) string {
if _, ok := constants.StaticFieldsLogsV3[item.Key.Key]; ok && item.Key.Type == v3.AttributeKeyTypeUnspecified {
// no exists filter for static fields as they exists everywhere
// TODO(nitya): Think what we can do here
return ""
// https://opentelemetry.io/docs/specs/otel/logs/data-model/
// for top level keys of the log model: trace_id, span_id, severity_number, trace_flags etc
// we don't have an exists column.
// to check if they exists/nexists
// we can use = 0 or != 0 for numbers
// we can use = '' or != '' for strings
chOp := "!="
if op == v3.FilterOperatorNotExists {
chOp = "="
}
key := getClickhouseKey(item.Key)
if item.Key.DataType == v3.AttributeKeyDataTypeString {
return fmt.Sprintf("%s %s ''", key, chOp)
}
// we just have two types, number and string for top level columns

return fmt.Sprintf("%s %s 0", key, chOp)
} else if item.Key.IsColumn {
// get filter for materialized columns
val := true
Expand Down
10 changes: 9 additions & 1 deletion pkg/query-service/app/logs/v4/query_builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,15 @@ func Test_getExistsNexistsFilter(t *testing.T) {
op: v3.FilterOperatorExists,
item: v3.FilterItem{Key: v3.AttributeKey{Key: "trace_id", DataType: v3.AttributeKeyDataTypeString, Type: v3.AttributeKeyTypeUnspecified}},
},
want: "",
want: "trace_id != ''",
},
{
name: "exists top level column- number",
args: args{
op: v3.FilterOperatorNotExists,
item: v3.FilterItem{Key: v3.AttributeKey{Key: "severity_number", DataType: v3.AttributeKeyDataTypeArrayFloat64, Type: v3.AttributeKeyTypeUnspecified}},
},
want: "severity_number = 0",
},
}
for _, tt := range tests {
Expand Down
1 change: 1 addition & 0 deletions signoz-core-ui
Submodule signoz-core-ui added at f8c925

0 comments on commit eee5c0c

Please sign in to comment.