Compare commits

...

3 Commits

Author SHA1 Message Date
Tushar Vats
459e7cfd5c fix: added a unit test 2026-04-20 19:22:23 +05:30
Tushar Vats
4908220d01 fix: disallow group by timestamp for timeseries request 2026-04-20 19:11:58 +05:30
Yunus M
5d6ada7a5b fix: semantic token issues in aws refactor (#11014)
* fix: semantic token issues in aws refactor

* fix: semantic token issues in aws refactor

* chore: remove unnecessary light mode styles
2026-04-20 12:34:25 +00:00
10 changed files with 104 additions and 11 deletions

View File

@@ -62,8 +62,8 @@
"@signozhq/popover": "0.1.2",
"@signozhq/radio-group": "0.0.4",
"@signozhq/resizable": "0.0.2",
"@signozhq/table": "0.3.7",
"@signozhq/tabs": "0.0.11",
"@signozhq/table": "0.3.8",
"@signozhq/toggle-group": "0.0.3",
"@signozhq/ui": "0.0.5",
"@tanstack/react-table": "8.21.3",

View File

@@ -24,7 +24,7 @@ import '@signozhq/input';
import '@signozhq/popover';
import '@signozhq/radio-group';
import '@signozhq/resizable';
import '@signozhq/table';
import '@signozhq/tabs';
import '@signozhq/table';
import '@signozhq/toggle-group';
import '@signozhq/ui';

View File

@@ -109,11 +109,14 @@
border: 1px solid var(--l3-background);
background: var(--l1-background);
box-shadow: 4px 10px 16px 2px rgba(0, 0, 0, 0.2);
.ant-select-selector {
border-color: var(--l1-border) !important;
background: var(--l1-background) !important;
padding: 6px 8px !important;
min-width: 140px !important;
}
.ant-select-item-option-active {
background: var(--l3-background) !important;
}

View File

@@ -58,6 +58,7 @@ function AccountActionsRenderer({
value={activeAccount?.providerAccountId}
options={selectOptions}
rootClassName="cloud-account-selector"
popupMatchSelectWidth={false}
placeholder="Select AWS Account"
suffixIcon={<ChevronDown size={16} color={Color.BG_VANILLA_400} />}
onChange={onAccountChange}

View File

@@ -84,7 +84,7 @@ function AccountSettingsModal({
<div className="account-settings-modal__body-account-info-connected-account-details-account-id">
AWS Account:{' '}
<span className="account-settings-modal__body-account-info-connected-account-details-account-id-account-id">
{account?.id}
{account?.providerAccountId}
</span>
</div>
</div>

View File

@@ -42,6 +42,10 @@
align-items: center;
gap: 8px;
margin-top: 16px;
input {
color: var(--l1-foreground);
}
}
}

View File

@@ -20,6 +20,8 @@ body {
font-optical-sizing: auto;
font-weight: 400;
font-style: normal;
background: var(--l1-background) !important;
color: var(--l1-foreground) !important;
}
body {
@@ -795,3 +797,20 @@ notifications - 2050
.bg-border {
background: color-mix(in srgb, var(--l3-background) 20%, transparent);
}
[data-slot='drawer-content'] {
background: var(--l1-background) !important;
border: 1px solid var(--l1-border) !important;
[data-slot='drawer-title'] {
color: var(--l1-foreground) !important;
}
[data-slot='drawer-close'] {
color: var(--l1-foreground) !important;
}
[data-slot='drawer-body'] {
color: var(--l1-foreground) !important;
}
}

View File

@@ -5735,14 +5735,14 @@
tailwind-merge "^2.5.2"
tailwindcss-animate "^1.0.7"
"@signozhq/table@0.3.7":
version "0.3.7"
resolved "https://registry.yarnpkg.com/@signozhq/table/-/table-0.3.7.tgz#895b710c02af124dfb5117e02bbc6d80ce062063"
integrity sha512-XDwRHBTf2q48MOuxkzzr0htWd0/mmvgHoZLl0WAMLk2gddbbNHg9hkCPfVARYOke6mX8Z/4T3e7dzgkRUhDGDg==
"@signozhq/table@0.3.8":
version "0.3.8"
resolved "https://registry.yarnpkg.com/@signozhq/table/-/table-0.3.8.tgz#dc0ec75ba184990069753df40107477518d854bf"
integrity sha512-YxQtMNJ3jA5yXG0UmECk6rW3E6CrZ5ayCEwWSHzKnHzRTYW3gDHoe1WedYkRAt3JmReo8ox1Sh2PdWewvB6Fyg==
dependencies:
"@radix-ui/react-icons" "^1.3.0"
"@radix-ui/react-slot" "^1.1.0"
"@signozhq/tooltip" "0.0.2"
"@signozhq/icons" "^0.1.0"
"@tanstack/react-table" "^8.21.3"
"@tanstack/react-virtual" "^3.13.9"
"@types/lodash-es" "^4.17.12"

View File

@@ -53,6 +53,7 @@ type validationConfig struct {
skipAggregationOrderBy bool
skipSelectFieldValidation bool
skipGroupByValidation bool
requestType RequestType
}
func applyValidationOptions(opts []ValidationOption) validationConfig {
@@ -111,6 +112,13 @@ func WithSkipGroupByValidation() ValidationOption {
}
}
// WithRequestType sets the request type for validation.
func WithRequestType(requestType RequestType) ValidationOption {
return func(cfg *validationConfig) {
cfg.requestType = requestType
}
}
// Validate performs preliminary validation on QueryBuilderQuery.
func (q *QueryBuilderQuery[T]) Validate(opts ...ValidationOption) error {
cfg := applyValidationOptions(opts)
@@ -177,6 +185,11 @@ func (q *QueryBuilderQuery[T]) validateGroupBy(cfg validationConfig) error {
errors.CodeInvalidInput, "invalid empty key name for group by at index %d", idx,
)
}
if cfg.requestType == RequestTypeTimeSeries && item.Name == "timestamp" {
return errors.NewInvalidInputf(
errors.CodeInvalidInput, "group by on timestamp is not allowed for request type %s", cfg.requestType.StringValue(),
).WithAdditional("Timeseries request already accounts for timestamp in the response")
}
}
return nil
}
@@ -666,10 +679,10 @@ func validateQueryEnvelope(envelope QueryEnvelope, opts ...ValidationOption) err
func GetValidationOptions(requestType RequestType) []ValidationOption {
switch requestType {
case RequestTypeTimeSeries, RequestTypeScalar:
return []ValidationOption{WithSkipSelectFieldValidation()}
return []ValidationOption{WithSkipSelectFieldValidation(), WithRequestType(requestType)}
case RequestTypeRaw, RequestTypeRawStream, RequestTypeTrace:
return []ValidationOption{WithSkipAggregationValidation(), WithSkipHavingValidation(), WithSkipAggregationOrderBy(), WithSkipGroupByValidation()}
return []ValidationOption{WithSkipAggregationValidation(), WithSkipHavingValidation(), WithSkipAggregationOrderBy(), WithSkipGroupByValidation(), WithRequestType(requestType)}
default:
return []ValidationOption{}
return []ValidationOption{WithRequestType(requestType)}
}
}

View File

@@ -695,6 +695,59 @@ func TestQueryRangeRequest_ValidateCompositeQuery(t *testing.T) {
wantErr: true,
errMsg: "raw request type is not supported for metric queries",
},
{
name: "timeseries request with group by timestamp should return error",
request: QueryRangeRequest{
Start: 1640995200000,
End: 1640998800000,
RequestType: RequestTypeTimeSeries,
CompositeQuery: CompositeQuery{
Queries: []QueryEnvelope{
{
Type: QueryTypeBuilder,
Spec: QueryBuilderQuery[LogAggregation]{
Name: "A",
Signal: telemetrytypes.SignalLogs,
Aggregations: []LogAggregation{
{Expression: "count()"},
},
GroupBy: []GroupByKey{
{TelemetryFieldKey: telemetrytypes.TelemetryFieldKey{Name: "timestamp"}},
},
},
},
},
},
},
wantErr: true,
errMsg: "group by on timestamp is not allowed",
},
{
name: "scalar request with group by timestamp should pass",
request: QueryRangeRequest{
Start: 1640995200000,
End: 1640998800000,
RequestType: RequestTypeScalar,
CompositeQuery: CompositeQuery{
Queries: []QueryEnvelope{
{
Type: QueryTypeBuilder,
Spec: QueryBuilderQuery[LogAggregation]{
Name: "A",
Signal: telemetrytypes.SignalLogs,
Aggregations: []LogAggregation{
{Expression: "count()"},
},
GroupBy: []GroupByKey{
{TelemetryFieldKey: telemetrytypes.TelemetryFieldKey{Name: "timestamp"}},
},
},
},
},
},
},
wantErr: false,
},
{
name: "raw request with log query without aggregations should pass",
request: QueryRangeRequest{