Compare commits

..

8 Commits

Author SHA1 Message Date
Naman Verma
105f023f32 Merge branch 'main' into nv/exec-stats 2026-11-23 10:11:50 +05:30
Naman Verma
8101a79371 Merge branch 'main' into nv/exec-stats 2026-11-16 10:43:03 +05:30
Naman Verma
62d477e920 Merge branch 'main' into nv/exec-stats 2026-11-09 12:20:27 +05:30
Naman Verma
fe45b9dcae Merge branch 'main' into nv/exec-stats 2026-11-06 00:51:46 +05:30
Naman Verma
63ee60a40c fix(querier): stop cache refreshes from inflating exec stats 2026-11-06 00:51:03 +05:30
Naman Verma
29a393e47e Merge branch 'main' into nv/exec-stats 2026-11-05 10:51:11 +05:30
Naman Verma
c58f76f998 Merge branch 'main' into nv/exec-stats 2026-11-03 11:34:10 +05:30
Naman Verma
e39ad9e221 test: check how exec stats fail 2026-11-02 22:24:22 +05:30
1111 changed files with 25911 additions and 8183 deletions

View File

@@ -9,14 +9,12 @@ paths:
Examples and the harness API live in [`frontend/src/tests/README.md`](../../frontend/src/tests/README.md).
- **Import from the harness.** `render`, `screen`, `userEvent`, `waitFor` and the rest come from `tests/test-utils`, never from `@testing-library/react`. The harness mounts the router, React Query, Redux, app context and preferences. When it can't do what a test needs, extend `tests/test-utils` instead of importing around it.
- **Find elements by test ID.** Query with `getByTestId`/`findByTestId` on the `data-testid` or `testId` the component exposes, and add one to the component when it has none. Fall back to role or text only for markup the app doesn't own. A test ID matches exactly one element and survives copy and markup changes; `getByRole` computes the accessibility tree on every call and is the slowest query. Never call a `*ByRole` query inside `waitFor` or a loop: `waitFor` re-runs its callback every 50 ms. Wait with `findByTestId`, then query.
- **Interact like a user.** `const user = userEvent.setup()`, then an awaited `user.click`, `hover`, `keyboard` or `type`. The harness turns off the pointer-events check, which walks `getComputedStyle` up the tree on every action; never turn it back on. `fireEvent` only for events `userEvent` has no equivalent for: scroll, resize, setting `scrollTop`.
- **Find elements by test ID.** Query with `getByTestId`/`findByTestId` on the `data-testid` or `testId` the component exposes, and add one to the component when it has none. Fall back to role or text only for markup the app doesn't own. A test ID matches exactly one element and survives copy and markup changes; `getByRole` computes the accessibility tree on every call and is the slowest query.
- **Interact like a user.** `const user = userEvent.setup({ pointerEventsCheck: 0 })`, then an awaited `user.click`, `hover`, `keyboard` or `type`. `fireEvent` only for events `userEvent` has no equivalent for: scroll, resize, setting `scrollTop`.
- **Fake timers per test only**, for debounce or throttle, with `userEvent.setup({ advanceTimers: (ms) => jest.advanceTimersByTime(ms) })`. Never global.
- **Network through MSW.** The global server runs for every test; override per test with `server.use(...)` from `mocks-server/server`. Large fixtures go in `mocks-server/__mockdata__`.
- **Router through the harness.** Pass `initialRoute`/`routePath` to `render` and assert with `getCurrentLocation()` from `lib/router/navigation`. Never mock `react-router`, `react-router-dom` or `lib/history`; when a test can't render at a route, use the `lib/router` spies in `tests/router-mocks`.
- **Mock only business boundaries.** Local `jest.mock` for API modules, custom hooks and domain components. Never re-mock what the harness provides (`@floating-ui/dom`, `@testing-library/user-event` and antd's `collectScroller` in `jest.setup.ts`) or what `jest.config.ts` maps (`uplot`, `@signozhq/icons`, `useSafeNavigate`, `logEvent`).
- **Mock only business boundaries.** Local `jest.mock` for API modules, custom hooks and domain components. Never re-mock what the harness provides or what `jest.config.ts` maps (`uplot`, `@signozhq/icons`, `useSafeNavigate`, `logEvent`).
- **Type mocks and fixtures.** `jest.mocked(fn)` for module mocks, `jest.fn() as jest.MockedFunction<T>` for a standalone mock you configure or assert on. Fixtures carry their real type, from `src/api/generated` where it exists. No `any`, no `as unknown as`. An inline `onX={jest.fn()}` on a typed prop that is never asserted needs no annotation.
- **One behaviour per test, at the smallest render.** Render the component that owns the behaviour, not the page around it, unless the page wiring is the behaviour. A flow of steps (a wizard, a multi-step form) becomes one test per step that starts at that step through props, store or route. A full click-through belongs in the e2e suite (`tests/e2e`).
- **Each test under 500 ms.** `pnpm jest <file> --verbose` prints each test's time. CI runs about four times slower than a laptop, and the timeout is 5 s. Never raise a timeout (`jest.setTimeout`, a third argument to `it`) to make a slow test pass; slim the test instead.
- **A test fails without its change.** At the gate in [`frontend/AGENTS.md`](../../frontend/AGENTS.md), revert the change, or break the line under test, and run the test: it must fail, and each test must stay under 500 ms. Assert the specific outcome (exact text, request payload, call arguments), never only that an element exists.
- **A test fails without its change.** Revert the change, or break the line under test, and run the test before you finish: it must fail. Assert the specific outcome (exact text, request payload, call arguments), never only that an element exists.
- **No limit on tests per file.** Split a file when it mixes unrelated behaviour, not to hit a count.

View File

@@ -15,4 +15,3 @@ paths:
- When defining types, keep the structure of file to have any constants and variables first, then exported types and exported methods and then finally the unexported types and methods.
- Never import types or other modules in migration files, duplicate the required type or method to keep migration free from changes.
- Always run the gofmt tool for formating beforing commiting any changes.
- **Never copy through a pointer dereference** (`copied := *original`). It copies only the top level: pointer, slice and map fields stay shared, so changing the copy can change the original. Use the type's `Copy()` when it has one (`QueryBuilderFormula.Copy`); otherwise create a new struct literal from the fields you need. A `Copy()` itself may dereference, as long as it then replaces every pointer, slice and map field.

View File

@@ -94,7 +94,7 @@ jobs:
postgres:15 \
clickhouse/clickhouse-server:25.12.5 \
clickhouse/clickhouse-keeper:25.12.5 \
signoz/signoz-otel-collector:v0.144.17 \
signoz/signoz-otel-collector:v0.144.16-rc.1 \
wiremock/wiremock:2.35.1-1 \
| xargs -P 0 -n 1 docker pull -q
- name: python

View File

@@ -85,18 +85,13 @@ jobs:
- wal
clickhouse-version:
- 25.12.5
- 26.8.34
signoz-otel-collector-version:
- v0.144.17
- v0.144.16-rc.1
postgres-version:
- 15
exclude:
- sqlstore-provider: postgres
clickhouse-version: 26.8.34
if: |
((github.event_name == 'pull_request' && ! github.event.pull_request.head.repo.fork && github.event.pull_request.user.login != 'dependabot[bot]' && ! contains(github.event.pull_request.labels.*.name, 'safe-to-test')) ||
(github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'safe-to-test'))) && contains(github.event.pull_request.labels.*.name, 'safe-to-integrate')
continue-on-error: ${{ matrix.clickhouse-version == '26.8.34' }}
runs-on: ubuntu-latest
steps:
- name: checkout

View File

@@ -474,14 +474,6 @@ auditor:
compression: lz4
# The maximum time to drain buffered events on shutdown. Undelivered events are dropped after it.
shutdown_timeout: 30s
tls:
# Whether to connect to the brokers over TLS.
enabled: false
# The PEM CA bundle that verifies broker certificates. Empty uses the system roots.
ca_file: ""
# The client certificate and key, for brokers that require client auth. Set both or neither.
cert_file: ""
key_file: ""
##################### Cloud Integration #####################
cloudintegration:

View File

@@ -16274,22 +16274,13 @@ paths:
where it is case-sensitive and % and _ act as wildcards. For keys, a context
prefix such as resource.service.name sets fieldContext when it is empty.'
type: string
- description: 'The key whose values to return, such as service.name. With fieldContext
set, it is the stored name as is. Otherwise a context prefix such as resource.service.name
sets the context and a type suffix such as service.name:string sets fieldDataType
when that is empty; as in filter expressions, a prefixed name also matches
a key stored under the full name, whose values come first: log.level returns
values of a key named log.level, then of the log field level.'
- description: The key whose values to return, such as service.name. A context
prefix such as resource.service.name sets fieldContext when it is empty.
in: query
name: name
schema:
description: 'The key whose values to return, such as service.name. With
fieldContext set, it is the stored name as is. Otherwise a context prefix
such as resource.service.name sets the context and a type suffix such
as service.name:string sets fieldDataType when that is empty; as in filter
expressions, a prefixed name also matches a key stored under the full
name, whose values come first: log.level returns values of a key named
log.level, then of the log field level.'
description: The key whose values to return, such as service.name. A context
prefix such as resource.service.name sets fieldContext when it is empty.
type: string
- description: Filter expression already applied in the explorer. When set,
relatedValues lists the values seen on data matching it.
@@ -28936,22 +28927,13 @@ paths:
where it is case-sensitive and % and _ act as wildcards. For keys, a context
prefix such as resource.service.name sets fieldContext when it is empty.'
type: string
- description: 'The key whose values to return, such as service.name. With fieldContext
set, it is the stored name as is. Otherwise a context prefix such as resource.service.name
sets the context and a type suffix such as service.name:string sets fieldDataType
when that is empty; as in filter expressions, a prefixed name also matches
a key stored under the full name, whose values come first: log.level returns
values of a key named log.level, then of the log field level.'
- description: The key whose values to return, such as service.name. A context
prefix such as resource.service.name sets fieldContext when it is empty.
in: query
name: name
schema:
description: 'The key whose values to return, such as service.name. With
fieldContext set, it is the stored name as is. Otherwise a context prefix
such as resource.service.name sets the context and a type suffix such
as service.name:string sets fieldDataType when that is empty; as in filter
expressions, a prefixed name also matches a key stored under the full
name, whose values come first: log.level returns values of a key named
log.level, then of the log field level.'
description: The key whose values to return, such as service.name. A context
prefix such as resource.service.name sets fieldContext when it is empty.
type: string
- description: Filter expression already applied in the explorer. When set,
relatedValues lists the values seen on data matching it.

View File

@@ -2,10 +2,7 @@ package kafkaauditor
import (
"context"
"crypto/tls"
"crypto/x509"
"log/slog"
"os"
"github.com/twmb/franz-go/pkg/kgo"
"github.com/twmb/franz-go/plugin/kslog"
@@ -13,7 +10,6 @@ import (
"github.com/SigNoz/signoz/pkg/auditor"
"github.com/SigNoz/signoz/pkg/auditor/auditorserver"
"github.com/SigNoz/signoz/pkg/errors"
"github.com/SigNoz/signoz/pkg/factory"
"github.com/SigNoz/signoz/pkg/licensing"
"github.com/SigNoz/signoz/pkg/types/audittypes"
@@ -43,25 +39,13 @@ func newProvider(_ context.Context, providerSettings factory.ProviderSettings, c
// Acks from all in-sync replicas, idempotent writes and unbounded record retries are franz-go defaults and are kept as is.
// A delivery timeout or retry limit lets franz-go < v1.22.2 ack a record that was never written (twmb/franz-go#1484).
opts := []kgo.Opt{
client, err := kgo.NewClient(
kgo.SeedBrokers(config.Kafka.Brokers...),
kgo.ClientID(config.Kafka.ClientID),
kgo.ProducerBatchCompression(compressionCodec(config.Kafka.Compression)),
kgo.ProducerLinger(0),
kgo.WithLogger(kslog.New(settings.Logger())),
}
if config.Kafka.TLS.Enabled {
tlsConfig, err := newTLSConfig(config.Kafka.TLS)
if err != nil {
return nil, err
}
// franz-go sets ServerName per broker from the dialed address.
opts = append(opts, kgo.DialTLSConfig(tlsConfig))
}
client, err := kgo.NewClient(opts...)
)
if err != nil {
return nil, err
}
@@ -146,30 +130,3 @@ func compressionCodec(name string) kgo.CompressionCodec {
return kgo.NoCompression()
}
}
func newTLSConfig(config auditor.TLSConfig) (*tls.Config, error) {
tlsConfig := &tls.Config{}
if config.CAFile != "" {
caPEM, err := os.ReadFile(config.CAFile)
if err != nil {
return nil, errors.WrapInvalidInputf(err, errors.CodeInvalidInput, "cannot read auditor::kafka::tls::ca_file")
}
tlsConfig.RootCAs = x509.NewCertPool()
if !tlsConfig.RootCAs.AppendCertsFromPEM(caPEM) {
return nil, errors.NewInvalidInputf(errors.CodeInvalidInput, "auditor::kafka::tls::ca_file %q holds no PEM certificate", config.CAFile)
}
}
if config.CertFile != "" {
cert, err := tls.LoadX509KeyPair(config.CertFile, config.KeyFile)
if err != nil {
return nil, errors.WrapInvalidInputf(err, errors.CodeInvalidInput, "cannot load auditor::kafka::tls::cert_file and auditor::kafka::tls::key_file")
}
tlsConfig.Certificates = []tls.Certificate{cert}
}
return tlsConfig, nil
}

View File

@@ -1,269 +0,0 @@
package kafkaauditor
import (
"context"
"crypto/ecdsa"
"crypto/elliptic"
"crypto/rand"
"crypto/tls"
"crypto/x509"
"crypto/x509/pkix"
"encoding/pem"
"math/big"
"net"
"os"
"path/filepath"
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/twmb/franz-go/pkg/kfake"
"github.com/twmb/franz-go/pkg/kgo"
"github.com/SigNoz/signoz/pkg/auditor"
"github.com/SigNoz/signoz/pkg/errors"
"github.com/SigNoz/signoz/pkg/instrumentation/instrumentationtest"
"github.com/SigNoz/signoz/pkg/types/audittypes"
"github.com/SigNoz/signoz/pkg/types/coretypes"
"github.com/SigNoz/signoz/pkg/version"
)
func TestExport_MutualTLS(t *testing.T) {
certificates := newTestCertificates(t)
cluster, err := kfake.NewCluster(
kfake.NumBrokers(1),
kfake.SeedTopics(1, "tls_audit"),
kfake.TLS(&tls.Config{
Certificates: []tls.Certificate{certificates.server},
ClientCAs: certificates.caPool,
ClientAuth: tls.RequireAndVerifyClientCert,
}),
)
require.NoError(t, err)
t.Cleanup(cluster.Close)
testCases := []struct {
name string
tls auditor.TLSConfig
err bool
}{
{
name: "CAAndClientCertificate_Delivers",
tls: certificates.client,
},
{
name: "TLSDisabled_Fails",
tls: auditor.TLSConfig{},
err: true,
},
{
name: "WithoutClientCertificate_Fails",
tls: auditor.TLSConfig{Enabled: true, CAFile: certificates.client.CAFile},
err: true,
},
{
name: "WithoutCA_Fails",
tls: auditor.TLSConfig{Enabled: true, CertFile: certificates.client.CertFile, KeyFile: certificates.client.KeyFile},
err: true,
},
}
for _, testCase := range testCases {
t.Run(testCase.name, func(t *testing.T) {
config := auditor.Config{
Provider: "kafka",
BufferSize: 10,
BatchSize: 5,
FlushInterval: 50 * time.Millisecond,
Kafka: auditor.KafkaConfig{
Brokers: cluster.ListenAddrs(),
Topic: "tls_audit",
ClientID: "signoz-tls-test",
Compression: "lz4",
ShutdownTimeout: 30 * time.Second,
TLS: testCase.tls,
},
}
auditor, err := newProvider(context.Background(), instrumentationtest.New().ToProviderSettings(), config, nil, version.Info)
require.NoError(t, err)
provider := auditor.(*provider)
defer provider.client.Close()
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
defer cancel()
err = provider.export(ctx, []audittypes.AuditEvent{newTestEvent(coretypes.ResourceUser, coretypes.VerbCreate, testCase.name)})
if testCase.err {
assert.True(t, errors.Is(err, context.DeadlineExceeded))
return
}
require.NoError(t, err)
})
}
consumerTLS, err := newTLSConfig(certificates.client)
require.NoError(t, err)
consumer, err := kgo.NewClient(
kgo.SeedBrokers(cluster.ListenAddrs()...),
kgo.DialTLSConfig(consumerTLS),
kgo.ConsumeTopics("tls_audit"),
kgo.ConsumeResetOffset(kgo.NewOffset().AtStart()),
)
require.NoError(t, err)
defer consumer.Close()
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
fetches := consumer.PollFetches(ctx)
require.Empty(t, fetches.Errors())
assert.Len(t, fetches.Records(), 1)
}
func TestNewTLSConfig(t *testing.T) {
certificates := newTestCertificates(t)
notPEMFile := filepath.Join(t.TempDir(), "not-pem.crt")
require.NoError(t, os.WriteFile(notPEMFile, []byte("not a pem"), 0o600))
testCases := []struct {
name string
config auditor.TLSConfig
err bool
wantRootCAs bool
wantCertificates int
}{
{
name: "NoFiles_UsesSystemRoots",
config: auditor.TLSConfig{Enabled: true},
},
{
name: "CAOnly",
config: auditor.TLSConfig{Enabled: true, CAFile: certificates.client.CAFile},
wantRootCAs: true,
},
{
name: "CAAndClientCertificate",
config: certificates.client,
wantRootCAs: true,
wantCertificates: 1,
},
{
name: "CAFileMissing",
config: auditor.TLSConfig{Enabled: true, CAFile: filepath.Join(t.TempDir(), "missing-ca.crt")},
err: true,
},
{
name: "CAFileNotPEM",
config: auditor.TLSConfig{Enabled: true, CAFile: notPEMFile},
err: true,
},
{
name: "KeyFileMissing",
config: auditor.TLSConfig{Enabled: true, CertFile: certificates.client.CertFile, KeyFile: filepath.Join(t.TempDir(), "missing.key")},
err: true,
},
{
name: "CertFileNotPEM",
config: auditor.TLSConfig{Enabled: true, CertFile: notPEMFile, KeyFile: certificates.client.KeyFile},
err: true,
},
}
for _, testCase := range testCases {
t.Run(testCase.name, func(t *testing.T) {
tlsConfig, err := newTLSConfig(testCase.config)
if testCase.err {
assert.True(t, errors.Ast(err, errors.TypeInvalidInput))
return
}
require.NoError(t, err)
assert.Equal(t, testCase.wantRootCAs, tlsConfig.RootCAs != nil)
assert.Len(t, tlsConfig.Certificates, testCase.wantCertificates)
})
}
}
type testCertificates struct {
caPool *x509.CertPool
server tls.Certificate
client auditor.TLSConfig
}
// Issues a CA, a broker certificate for 127.0.0.1 and a client certificate, writing the client side as ca.crt, tls.crt and tls.key.
func newTestCertificates(t *testing.T) testCertificates {
t.Helper()
caKey, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader)
require.NoError(t, err)
caTemplate := &x509.Certificate{
SerialNumber: big.NewInt(1),
Subject: pkix.Name{CommonName: "test-ca"},
NotBefore: time.Now().Add(-time.Hour),
NotAfter: time.Now().Add(time.Hour),
IsCA: true,
BasicConstraintsValid: true,
KeyUsage: x509.KeyUsageCertSign,
}
caDER, err := x509.CreateCertificate(rand.Reader, caTemplate, caTemplate, &caKey.PublicKey, caKey)
require.NoError(t, err)
ca, err := x509.ParseCertificate(caDER)
require.NoError(t, err)
serverCertPEM, serverKeyPEM := issueTestCertificate(t, ca, caKey, &x509.Certificate{
SerialNumber: big.NewInt(2),
Subject: pkix.Name{CommonName: "broker"},
IPAddresses: []net.IP{net.ParseIP("127.0.0.1")},
ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth},
})
server, err := tls.X509KeyPair(serverCertPEM, serverKeyPEM)
require.NoError(t, err)
clientCertPEM, clientKeyPEM := issueTestCertificate(t, ca, caKey, &x509.Certificate{
SerialNumber: big.NewInt(3),
Subject: pkix.Name{CommonName: "signoz"},
ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageClientAuth},
})
dir := t.TempDir()
client := auditor.TLSConfig{
Enabled: true,
CAFile: filepath.Join(dir, "ca.crt"),
CertFile: filepath.Join(dir, "tls.crt"),
KeyFile: filepath.Join(dir, "tls.key"),
}
require.NoError(t, os.WriteFile(client.CAFile, pem.EncodeToMemory(&pem.Block{Type: "CERTIFICATE", Bytes: caDER}), 0o600))
require.NoError(t, os.WriteFile(client.CertFile, clientCertPEM, 0o600))
require.NoError(t, os.WriteFile(client.KeyFile, clientKeyPEM, 0o600))
caPool := x509.NewCertPool()
caPool.AddCert(ca)
return testCertificates{caPool: caPool, server: server, client: client}
}
func issueTestCertificate(t *testing.T, ca *x509.Certificate, caKey *ecdsa.PrivateKey, template *x509.Certificate) ([]byte, []byte) {
t.Helper()
key, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader)
require.NoError(t, err)
template.NotBefore = time.Now().Add(-time.Hour)
template.NotAfter = time.Now().Add(time.Hour)
template.KeyUsage = x509.KeyUsageDigitalSignature
der, err := x509.CreateCertificate(rand.Reader, template, ca, &key.PublicKey, caKey)
require.NoError(t, err)
keyDER, err := x509.MarshalECPrivateKey(key)
require.NoError(t, err)
return pem.EncodeToMemory(&pem.Block{Type: "CERTIFICATE", Bytes: der}), pem.EncodeToMemory(&pem.Block{Type: "EC PRIVATE KEY", Bytes: keyDER})
}

View File

@@ -99,7 +99,7 @@ is still by hand. The generator never adds a SideNav item; do that in
CSS Modules (`docs/css-modules-guide.md`), React Query for server state (prefer
`api/generated` hooks), nuqs for URL state, Zustand for client state, `data-testid` on
every interactive element.
5. **Verify** at the gate in `AGENTS.md` (commit, push or PR), not after each edit; skip it while the user says `no checks`:
5. **Verify** before reporting done:
```bash
pnpm tsgo --noEmit
pnpm oxlint src/pages/<Feature>

View File

@@ -506,6 +506,7 @@
"ignorePatterns": [
"src/parser/*.ts",
"scripts/update-registry.cjs",
"scripts/generate-permissions-type.cjs",
"**/node_modules",
"**/build",
"**/*.typegen.ts",

View File

@@ -28,24 +28,20 @@ You are operating within a constrained context window and strict system prompts.
- UI primitives come from `@signozhq/ui` (subpath imports) and icons from `@signozhq/icons`. No new `antd` component or direct icon library (`lucide-react`) where `@signozhq/ui` has an equivalent; `signoz/no-antd-components` enforces part of this list.
- Exception: a control added beside `antd` siblings of the same kind (a tab in an `antd` tab strip) matches them until that surface migrates. Say so in the PR.
- When `@signozhq/ui` or `@signozhq/icons` lacks what you need, say so in the PR before reaching for another library.
- Never override a `@signozhq/ui` component's styles: no `--<component>-*` CSS variables, no `:global` class or `data-*` selectors, no restyling through `className`/`style`. Use its props, and put layout on a wrapper you own. When it can't do what the design needs, file a UI suggestion in `SigNoz/uforge-pod` (`ui-suggestion.yml` template) and link it in the PR.
- Before styling a `@signozhq/ui` component, check its props in `node_modules/@signozhq/ui/dist/<component>/*.d.ts` for `className`/`style` support; some omit them. Avoid overriding the component's CSS vars unless explicitly needed.
- When writing code that could need authorization checks, read ./src/lib/authz/README.md
- A flow that gains a request also gates on that request's permission: a rename that now reads the view first needs `read` as well as `update`.
- Identity keys (legend groups, color groups, CSV headers, React keys) come from structured values, never from joined display text: `['us, east', 'prod']` and `['us', 'east, prod']` both join to `us, east, prod`.
- A payload saved under another kind or schema copies only the fields that schema accepts, and drops bindings to columns the user removed. The server rejects unknown or stale fields, so the preview works and the save fails.
3. CHECKS AT THE GATE: Your internal tools mark file writes as successful even if the code does not compile, so the checks below are required, but only at the gate. The gate is when the user says commit, push, raise or update the PR, mark it ready, or "run checks". Never run them after each edit or between the user's iterations.
- Between gates, after an edit, run at most the one test file that covers it.
- `no checks`: when the user says it (or "don't run tests", "just making changes"), run nothing: no tests, type check, lint, format or build. Make the change and stop. This holds until the user names a gate.
At the gate, you are FORBIDDEN from reporting a task as complete until you have:
3. FORCED VERIFICATION: Your internal tools mark file writes as successful even if the code does not compile. Run these checks once all changes of a task are done, never after each edit. You are FORBIDDEN from reporting a task as complete until you have:
- Run `pnpm tsgo --noEmit`
- Run `pnpm lint:js --quiet` to find critical errors
- Run `pnpm oxlint <file1> <file2>` and fix all warnings
- Run `pnpm build`
- Find if the file has tests for it, or if there's `__test__` folder or the parent folder has tests, and run. Run them before coding the change or after all changes, never in between.
- For e2e, run only the specs you added or changed: the stack is heavy. Leave the full jest and e2e suites to CI unless the user asks.
- For every test you added or changed, revert the change it covers and confirm the test fails, and that each test runs under 500 ms (`pnpm jest <file> --verbose`)
- For every test you added or changed, revert the change it covers and confirm the test fails
- On a stacked branch (`gh stack`), run `pnpm tsgo --noEmit` on every branch above it before pushing: a renamed prop or moved export breaks them
- Fixed ALL resulting errors

View File

@@ -9,12 +9,12 @@
- [ ] No deep class nesting (max 3 class levels; pseudo-classes/elements and parent-reference selectors like `&.active`, `&#bar` are not counted)
- [ ] No hardcoded colors - use `--l1/l2/l3-*` semantic tokens (not `--bg-*` primitives)
- [ ] No magic numbers - use `--spacing-*` tokens
- [ ] Typography uses `--{variant}-{size}-{weight}-*` text style tokens (see Typography)
- [ ] No overrides of `@signozhq/ui` components (see below)
- [ ] Global escapes only for third-party overrides (`@signozhq/ui` is not third-party)
- [ ] Typography uses `--periscope-font-size-*` or `--font-size-*` tokens
- [ ] @signozhq/ui overrides use CSS variables, not direct class overrides
- [ ] Global escapes only for third-party overrides
- [ ] No ID selectors
- [ ] No bare element selectors
- [ ] Keyframes are declared in the module with plain `@keyframes name` (already local)
- [ ] Keyframes use `:local(@keyframes name)` to avoid global collisions
## Config (vite.config.ts)
@@ -77,7 +77,7 @@ css: {
// BAD: Nesting creates separate classes you might not expect
.button {
.icon { } // -> styles.icon, but the rule is `.button .icon`: it only matches inside .button
.icon { } // -> styles.icon (separate class, not scoped under .button)
}
// GOOD: Flat structure
@@ -289,32 +289,88 @@ Use L1/L2/L3 semantic tokens - they handle light/dark theme automatically.
- L2 = elevated surfaces (cards, panels)
- L3 = nested/inset elements
## @signozhq/ui Components
## Overriding @signozhq/ui Components
Don't override them. That covers setting a component's `--<component>-*` CSS variables, targeting its classes or `data-*` attributes through `:global(...)`, and restyling it with `className` or `style`. An override keeps working until the component changes, then breaks with no type error or lint warning, and the screen drifts from every other one using that component.
Components expose CSS variables for customization.
- Use the component's props (`variant`, `color`, `size`, ...) for how it looks.
- Put layout (position, margin, width inside a flex or grid parent) on a wrapper element you own.
- If the component can't do what the design needs, file a [UI suggestion](https://github.com/SigNoz/uforge-pod/issues/new?template=ui-suggestion.yml) in `SigNoz/uforge-pod` and ship with the component as it renders until the suggestion is decided. Link the issue in the PR.
You can ensure they exist by looking at ./node_modules/@signozhq/ui/dist.
Never write a override without confirm it exists.
Override via:
### Method 1: CSS Variables (Preferred)
Each component exposes `--<component>-<property>` variables:
```scss
// BAD: Restyling the component
.saveButton {
--button-primary-background-color: var(--success-background);
// Override Button
.customButton {
--button-background: var(--success-background);
--button-border-radius: var(--radius-2);
--button-padding: var(--spacing-4) var(--spacing-8);
--button-font-size: var(--label-base-400-font-size);
}
.toolbar :global([data-variant="outlined"]) {
--button-variant-outlined-border: 1px solid var(--accent-primary);
// Override Input
.customInput {
--input-height: 2.5rem;
--input-border-color: var(--l2-border);
--input-padding: var(--spacing-2) var(--spacing-6);
--input-placeholder-color: var(--l3-foreground);
}
// GOOD: Layout on your own wrapper, looks from props
.toolbarActions {
display: flex;
gap: var(--spacing-4);
margin-left: auto;
// Override nested parts
.customInput {
--input-prefix-padding: 0 var(--spacing-4) 0 var(--spacing-6);
--input-suffix-color: var(--accent-primary);
}
```
### Method 2: Data Attributes
Components use data attributes for variants/states. Target them for state-specific overrides:
```scss
// Target variant
.wrapper :global([data-variant="outlined"]) {
--button-border-color: var(--accent-primary);
}
// Target size
.wrapper :global([data-size="sm"]) {
--button-font-size: var(--label-small-400-font-size);
}
// Target color
.wrapper :global([data-color="destructive"]) {
--button-background: var(--danger-background);
}
// Target state (Radix patterns)
.popover :global([data-state="open"]) {
opacity: 1;
}
.tooltip :global([data-side="top"]) {
margin-bottom: var(--spacing-2);
}
```
### Common Component CSS Variables
**Button:**
- `--button-background`, `--button-border-radius`, `--button-padding`
- `--button-font-size`, `--button-height`, `--button-gap`
- `--button-hover-background`, `--button-disabled-opacity`
**Input:**
- `--input-height`, `--input-border-color`, `--input-background`
- `--input-padding`, `--input-font-size`, `--input-placeholder-color`
- `--input-focus-outline-color`, `--input-hover-border-color`
- `--input-prefix-*`, `--input-suffix-*` for adornments
**General pattern:** `--<component>-<property>` or `--<component>-<state>-<property>`
## Good Patterns
### Structure
@@ -378,21 +434,24 @@ Don't override them. That covers setting a component's `--<component>-*` CSS var
### Keyframes (Local Scoping)
CSS Modules scope `@keyframes` like classes: the build renames `fadeIn` to `_fadeIn_<hash>` and rewrites every `animation` in the same module that names it. Don't wrap it in `:local(...)`; Sass rejects `:local(@keyframes fadeIn)` with `expected selector`.
Without `:local()`, keyframe names are global and can clash across modules:
```scss
// GOOD: Local to this module
// BAD: Global keyframe - can conflict with other modules
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
// GOOD: Locally scoped keyframe
:local(@keyframes fadeIn) {
from { opacity: 0; }
to { opacity: 1; }
}
.modal {
animation: fadeIn 200ms ease;
}
// BAD: Doesn't compile
:local(@keyframes fadeIn) { }
```
## JS Import Patterns

View File

@@ -12,6 +12,7 @@
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link rel="preconnect" href="https://cdn.vercel.com" crossorigin />
<title data-react-helmet="true">
Open source Observability platform | SigNoz

View File

@@ -6,8 +6,6 @@ const LOG_EVENT_MOCK_PATH = '<rootDir>/src/__tests__/logEventMock.ts';
const config: Config.InitialOptions = {
silent: true,
// CI runners are slow enough that multi-step userEvent tests pass 5s.
testTimeout: 10000,
clearMocks: true,
coverageDirectory: 'coverage',
coverageReporters: ['text', 'cobertura', 'html', 'json-summary'],
@@ -21,8 +19,9 @@ const config: Config.InitialOptions = {
// it, so redirect any import of it to a stub.
'(^|/)iconAssets$': '<rootDir>/__mocks__/iconAssetsMock.ts',
'^@/(.*)$': '<rootDir>/src/$1',
'\\.(css|scss)$': '<rootDir>/__mocks__/cssMock.ts',
'\\.(css|less|scss)$': '<rootDir>/__mocks__/cssMock.ts',
'\\.module\\.mjs$': '<rootDir>/__mocks__/cssMock.ts',
'\\.md$': '<rootDir>/__mocks__/cssMock.ts',
'^uplot$': '<rootDir>/__mocks__/uplotMock.ts',
'^motion/react$': '<rootDir>/__mocks__/motionMock.tsx',
'^hooks/useSafeNavigate$': USE_SAFE_NAVIGATE_MOCK_PATH,
@@ -57,18 +56,17 @@ const config: Config.InitialOptions = {
},
// TODO: https://github.com/SigNoz/engineering-pod/issues/5334
transformIgnorePatterns: [
// @chenglou/pretext is ESM-only; @signozhq/ui pulls it in via text-ellipsis.
// Pattern 1: allow .pnpm virtual store through (handled by pattern 2), plus root-level ESM packages.
'node_modules/(?!(\\.pnpm|react-json-tree|react-base16-styling|lodash-es|react-dnd|@react-dnd|dnd-core|react-dnd-html5-backend|axios|@signozhq/design-tokens|@signozhq|date-fns|d3-interpolate|d3-color|d3-geo|d3-array|internmap|ol|rbush|quickselect|earcut|@codemirror|@lezer|@marijn|@grafana|nuqs|uuid|react-markdown|vfile|vfile-message|unist-util-stringify-position|unified|bail|is-plain-obj|trough|remark-parse|remark-gfm|mdast-util-gfm|mdast-util-gfm-autolink-literal|mdast-util-gfm-footnote|mdast-util-gfm-strikethrough|mdast-util-gfm-table|mdast-util-gfm-task-list-item|mdast-util-find-and-replace|mdast-util-phrasing|mdast-util-to-markdown|markdown-table|longest-streak|ccount|escape-string-regexp|mdast-util-from-markdown|mdast-util-to-string|micromark|micromark-core-commonmark|micromark-extension-gfm|micromark-extension-gfm-autolink-literal|micromark-extension-gfm-footnote|micromark-extension-gfm-strikethrough|micromark-extension-gfm-table|micromark-extension-gfm-tagfilter|micromark-extension-gfm-task-list-item|micromark-factory-destination|micromark-factory-label|micromark-factory-space|micromark-factory-title|micromark-factory-whitespace|micromark-util-character|micromark-util-chunked|micromark-util-classify-character|micromark-util-combine-extensions|micromark-util-decode-numeric-character-reference|micromark-util-decode-string|micromark-util-encode|micromark-util-html-tag-name|micromark-util-normalize-identifier|micromark-util-resolve-all|micromark-util-sanitize-uri|micromark-util-subtokenize|micromark-util-symbol|micromark-util-types|decode-named-character-reference|remark-rehype|mdast-util-to-hast|unist-util-position|trim-lines|unist-util-visit|unist-util-visit-parents|unist-util-is|unist-util-generated|mdast-util-definitions|property-information|hast-util-whitespace|space-separated-tokens|comma-separated-tokens|rehype-raw|hast-util-raw|hast-util-from-parse5|devlop|hastscript|hast-util-parse-selector|vfile-location|web-namespaces|hast-util-to-parse5|zwitch|html-void-elements)/)',
'node_modules/(?!(\\.pnpm|react-json-tree|react-base16-styling|lodash-es|react-dnd|core-dnd|@react-dnd|dnd-core|react-dnd-html5-backend|axios|@chenglou/pretext|@signozhq/design-tokens|@signozhq|date-fns|d3-interpolate|d3-color|d3-geo|d3-array|internmap|ol|rbush|quickselect|earcut|api|@codemirror|@lezer|@marijn|@grafana|nuqs|uuid|copy-text-to-clipboard|react-markdown|vfile|vfile-message|unist-util-stringify-position|unified|bail|is-plain-obj|trough|remark-parse|remark-gfm|mdast-util-gfm|mdast-util-gfm-autolink-literal|mdast-util-gfm-footnote|mdast-util-gfm-strikethrough|mdast-util-gfm-table|mdast-util-gfm-task-list-item|mdast-util-find-and-replace|mdast-util-phrasing|mdast-util-to-markdown|markdown-table|longest-streak|ccount|escape-string-regexp|mdast-util-from-markdown|mdast-util-to-string|micromark|micromark-core-commonmark|micromark-extension-gfm|micromark-extension-gfm-autolink-literal|micromark-extension-gfm-footnote|micromark-extension-gfm-strikethrough|micromark-extension-gfm-table|micromark-extension-gfm-tagfilter|micromark-extension-gfm-task-list-item|micromark-factory-destination|micromark-factory-label|micromark-factory-space|micromark-factory-title|micromark-factory-whitespace|micromark-util-character|micromark-util-chunked|micromark-util-classify-character|micromark-util-combine-extensions|micromark-util-decode-numeric-character-reference|micromark-util-decode-string|micromark-util-encode|micromark-util-html-tag-name|micromark-util-normalize-identifier|micromark-util-resolve-all|micromark-util-sanitize-uri|micromark-util-subtokenize|micromark-util-symbol|micromark-util-types|decode-named-character-reference|remark-rehype|mdast-util-to-hast|unist-util-position|trim-lines|unist-util-visit|unist-util-visit-parents|unist-util-is|unist-util-generated|mdast-util-definitions|property-information|hast-util-whitespace|space-separated-tokens|comma-separated-tokens|rehype-raw|hast-util-raw|hast-util-from-parse5|devlop|hastscript|hast-util-parse-selector|vfile-location|web-namespaces|hast-util-to-parse5|zwitch|html-void-elements)/)',
// Pattern 2: pnpm virtual store — ignore everything except ESM-only packages.
// pnpm encodes scoped packages as @scope+name@version, so match on scope prefix.
'node_modules/\\.pnpm/(?!(react-json-tree|react-base16-styling|lodash-es|react-dnd|@react-dnd|dnd-core|react-dnd-html5-backend|axios|@signozhq|date-fns|d3-interpolate|d3-color|d3-geo|d3-array|internmap|ol|rbush|quickselect|earcut|@codemirror|@lezer|@marijn|@grafana|nuqs|uuid|react-markdown|vfile|vfile-message|unist-util-stringify-position|unified|bail|is-plain-obj|trough|remark-parse|remark-gfm|mdast-util-gfm|mdast-util-gfm-autolink-literal|mdast-util-gfm-footnote|mdast-util-gfm-strikethrough|mdast-util-gfm-table|mdast-util-gfm-task-list-item|mdast-util-find-and-replace|mdast-util-phrasing|mdast-util-to-markdown|markdown-table|longest-streak|ccount|escape-string-regexp|mdast-util-from-markdown|mdast-util-to-string|micromark|decode-named-character-reference|remark-rehype|mdast-util-to-hast|unist-util-position|trim-lines|unist-util-visit|unist-util-visit-parents|unist-util-is|unist-util-generated|mdast-util-definitions|property-information|hast-util-whitespace|space-separated-tokens|comma-separated-tokens|rehype-raw|hast-util-raw|hast-util-from-parse5|devlop|hastscript|hast-util-parse-selector|vfile-location|web-namespaces|hast-util-to-parse5|zwitch|html-void-elements)[^/]*/node_modules)',
'node_modules/\\.pnpm/(?!(react-json-tree|react-base16-styling|lodash-es|react-dnd|core-dnd|@react-dnd|dnd-core|react-dnd-html5-backend|axios|@chenglou|@signozhq|date-fns|d3-interpolate|d3-color|d3-geo|d3-array|internmap|ol|rbush|quickselect|earcut|api|@codemirror|@lezer|@marijn|@grafana|nuqs|uuid|copy-text-to-clipboard|react-markdown|vfile|vfile-message|unist-util-stringify-position|unified|bail|is-plain-obj|trough|remark-parse|remark-gfm|mdast-util-gfm|mdast-util-gfm-autolink-literal|mdast-util-gfm-footnote|mdast-util-gfm-strikethrough|mdast-util-gfm-table|mdast-util-gfm-task-list-item|mdast-util-find-and-replace|mdast-util-phrasing|mdast-util-to-markdown|markdown-table|longest-streak|ccount|escape-string-regexp|mdast-util-from-markdown|mdast-util-to-string|micromark|decode-named-character-reference|remark-rehype|mdast-util-to-hast|unist-util-position|trim-lines|unist-util-visit|unist-util-visit-parents|unist-util-is|unist-util-generated|mdast-util-definitions|property-information|hast-util-whitespace|space-separated-tokens|comma-separated-tokens|rehype-raw|hast-util-raw|hast-util-from-parse5|devlop|hastscript|hast-util-parse-selector|vfile-location|web-namespaces|hast-util-to-parse5|zwitch|html-void-elements)[^/]*/node_modules)',
],
setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
testPathIgnorePatterns: ['/node_modules/', '/public/'],
moduleDirectories: ['node_modules', 'src'],
testEnvironment: '<rootDir>/jest.environment.cjs',
// Local only: the default (cores - 1) workers exhaust RAM when several runs overlap.
...(process.env.CI ? {} : { maxWorkers: 4, workerIdleMemoryLimit: '1GB' }),
coverageThreshold: {
global: {
statements: 80,

View File

@@ -8,10 +8,12 @@
import { TextDecoder, TextEncoder } from 'node:util';
import '@testing-library/jest-dom';
import '@testing-library/jest-dom/extend-expect';
import 'jest-styled-components';
import { server } from './src/mocks-server/server';
import './src/styles.scss';
// Establish API mocking before all tests.
// react-router@7's entry point pulls in its server-runtime cookie signing,
@@ -37,8 +39,8 @@ if (!HTMLElement.prototype.scrollIntoView) {
HTMLElement.prototype.scrollIntoView = function (): void {};
}
// jsdom doesn't implement the Pointer Capture API, which Base UI primitives
// (e.g. @signozhq/ui Slider and ScrollArea) call. Stub them so those components
// jsdom doesn't implement the Pointer Capture API, which Radix UI primitives
// (e.g. @signozhq/ui Select) call when opening. Stub them so those components
// can be exercised in tests.
if (!HTMLElement.prototype.hasPointerCapture) {
HTMLElement.prototype.hasPointerCapture = function (): boolean {
@@ -120,8 +122,8 @@ if (typeof globalThis.DOMRect === 'undefined') {
// Patch getComputedStyle to handle CSS parsing errors from @signozhq/* packages.
// These packages inject CSS at import time via style-inject / vite-plugin-css-injected-by-js.
// jsdom's nwsapi cannot parse some of the injected selectors, causing SyntaxErrors
// during getComputedStyle / getByRole calls.
// jsdom's nwsapi cannot parse some of the injected selectors (e.g. Tailwind's :animate-in),
// causing SyntaxErrors during getComputedStyle / getByRole calls.
const _origGetComputedStyle = window.getComputedStyle;
window.getComputedStyle = function (
elt: Element,
@@ -130,13 +132,11 @@ window.getComputedStyle = function (
try {
return _origGetComputedStyle.call(window, elt, pseudoElt);
} catch {
// Return a minimal CSSStyleDeclaration so callers (testing-library, Base UI)
// Return a minimal CSSStyleDeclaration so callers (testing-library, Radix UI)
// see the element as visible and without animations.
return {
display: '',
visibility: '',
width: '',
height: '',
opacity: '1',
animationName: 'none',
getPropertyValue: () => '',
@@ -144,39 +144,6 @@ window.getComputedStyle = function (
}
};
// jsdom has no layout, and Floating UI's getComputedStyle walk over every
// popover ancestor costs up to ~1 s per open.
jest.mock('@floating-ui/dom', () => ({
...jest.requireActual('@floating-ui/dom'),
autoUpdate: (): (() => void) => (): void => {},
computePosition: (
_reference: unknown,
_floating: unknown,
{ placement = 'bottom', strategy = 'absolute' } = {},
): Promise<unknown> =>
Promise.resolve({ x: 0, y: 0, placement, strategy, middlewareData: {} }),
}));
jest.mock('@testing-library/user-event', () =>
jest.requireActual('tests/userEventWithDefaults'),
);
// antd popups walk getComputedStyle up every ancestor to find scroll
// containers on each open. pnpm keeps the package under antd, not at the root.
jest.mock(
require.resolve('@rc-component/trigger/lib/util', {
paths: [require.resolve('antd')],
}),
() => ({
...jest.requireActual(
require.resolve('@rc-component/trigger/lib/util', {
paths: [require.resolve('antd')],
}),
),
collectScroller: (): HTMLElement[] => [],
}),
);
beforeAll(() => server.listen());
afterEach(() => server.resetHandlers());

View File

@@ -1,18 +1,8 @@
{
"$schema": "https://unpkg.com/knip@5/schema.json",
"entry": [
"scripts/**/*.{mjs,cjs}",
"src/storybook/mocks/*.mock.{ts,tsx}",
"src/**/__tests__/floatingUiDomMock.ts"
],
"project": ["src/**/*.ts", "src/**/*.tsx"],
"ignore": [
"src/api/generated/**/*.ts",
"src/typings/*.ts",
"src/constants/generated/semconvFamilies.gen.ts",
".storybook/public/**"
],
"ignore": ["src/api/generated/**/*.ts", "src/typings/*.ts"],
"ignoreDependencies": [
"@typescript/native-preview"
]
}
}

View File

@@ -56,7 +56,6 @@
"@sentry/vite-plugin": "5.3.0",
"@signozhq/design-tokens": "2.8.0",
"@signozhq/icons": "0.4.0",
"@signozhq/noz-client": "1.13.0",
"@signozhq/ui": "0.4.0-rc.5",
"@tanstack/react-table": "8.21.3",
"@tanstack/react-virtual": "3.13.22",

View File

@@ -18,7 +18,7 @@ const BANNED_COMPONENTS = {
'Use @signozhq/ui/typography Typography instead of antd Typography.',
Switch: 'Use @signozhq/ui/switch Switch instead of antd Switch.',
Dropdown:
'Use @signozhq/ui/dropdown Dropdown instead of antd Dropdown.',
'Use @signozhq/ui DropdownMenuSimple (or the composable DropdownMenu primitives) from @signozhq/ui/dropdown-menu instead of antd Dropdown.',
Badge: 'Use @signozhq/ui/badge instead of antd Badge.',
Radio:
'Use @signozhq/ui/radio-group RadioGroup (dots) or @signozhq/ui/toggle-group ToggleGroup (segmented buttons) instead of antd Radio.',

View File

@@ -12,10 +12,10 @@
* And expects:
* import { Typography } from '@signozhq/ui/typography'
* import { Button } from '@signozhq/ui/button'
* import { toast } from '@signozhq/ui/toast'
* import { toast } from '@signozhq/ui/sonner'
*
* Why: the barrel eagerly require()s every component along with their
* Base UI/react-day-picker dependencies. Under Jest this caused
* Why: the barrel eagerly require()s every component (~90 of them) along with
* their Radix/cmdk/motion/react-day-picker dependencies. Under Jest this caused
* 5s timeouts and flaky tests after the Antd→@signozhq/ui Typography migration
* (#11199). Subpath imports (added in @signozhq/ui@0.0.18) load only what's
* used.
@@ -198,7 +198,7 @@ export default {
const report = {
node: node.source,
message:
"Do not import from the '@signozhq/ui' barrel. Use the matching subpath instead (e.g. '@signozhq/ui/typography', '@signozhq/ui/button', '@signozhq/ui/toast'). The barrel eagerly loads every component and slows tests substantially.",
"Do not import from the '@signozhq/ui' barrel. Use the matching subpath instead (e.g. '@signozhq/ui/typography', '@signozhq/ui/button', '@signozhq/ui/sonner'). The barrel eagerly loads ~90 components and slows tests substantially.",
};
if (replacement) {
report.fix = (fixer) => fixer.replaceText(node, replacement);

View File

@@ -82,9 +82,6 @@ importers:
'@signozhq/icons':
specifier: 0.4.0
version: 0.4.0
'@signozhq/noz-client':
specifier: 1.13.0
version: 1.13.0(axios@1.21.1)(react-query@3.39.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(react@18.2.0)
'@signozhq/ui':
specifier: 0.4.0-rc.5
version: 0.4.0-rc.5(@date-fns/tz@1.4.1)(@signozhq/design-tokens@2.8.0)(@signozhq/icons@0.4.0)(@types/react@18.0.26)(date-fns@4.1.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)
@@ -3251,13 +3248,6 @@ packages:
'@signozhq/icons@0.4.0':
resolution: {integrity: sha512-QctNvNPlQlsefFdIVmSy/P/7a1IcQ3IryKP0KPMqtoqew3q89FGUmFa5IfEJ7Z3CHhtG1zaXwBKqP72QkLyA3g==}
'@signozhq/noz-client@1.13.0':
resolution: {integrity: sha512-130L2xomHnQZK8ZtAst34qFz9d2rSF/JYpg9gKvJkZVS9+46CPZeTW8Va9PNS9Oa5owezVHIXZStTEbsHIxnwg==}
peerDependencies:
axios: ^1.20.0
react: ^18.2.0
react-query: ^3.39.3
'@signozhq/ui@0.4.0-rc.5':
resolution: {integrity: sha512-WlJMfeDfvL2hjMpTpHhhND/tuK7X0sfXQlx6E1ZG+6E/DYHpuhYljfvW3E6/BohIlHFlTyCs/ZMl9wnV2k9Zcw==}
peerDependencies:
@@ -12383,12 +12373,6 @@ snapshots:
'@signozhq/icons@0.4.0': {}
'@signozhq/noz-client@1.13.0(axios@1.21.1)(react-query@3.39.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(react@18.2.0)':
dependencies:
axios: 1.21.1
react: 18.2.0
react-query: 3.39.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0)
'@signozhq/ui@0.4.0-rc.5(@date-fns/tz@1.4.1)(@signozhq/design-tokens@2.8.0)(@signozhq/icons@0.4.0)(@types/react@18.0.26)(date-fns@4.1.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)':
dependencies:
'@base-ui/react': 1.8.0(@date-fns/tz@1.4.1)(@types/react@18.0.26)(date-fns@4.1.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)

View File

@@ -129,6 +129,18 @@ export const StatusPage = Loadable(
() => import(/* webpackChunkName: "All Status" */ 'pages/Status'),
);
export const OrganizationSettings = Loadable(
() => import(/* webpackChunkName: "All Settings" */ 'pages/Settings'),
);
export const IngestionSettings = Loadable(
() => import(/* webpackChunkName: "Ingestion Settings" */ 'pages/Settings'),
);
export const MySettings = Loadable(
() => import(/* webpackChunkName: "All MySettings" */ 'pages/Settings'),
);
export const Logs = Loadable(
() => import(/* webpackChunkName: "Logs" */ 'pages/LogsModulePage'),
);
@@ -169,6 +181,10 @@ export const LogsIndexToFields = Loadable(
import(/* webpackChunkName: "LogsIndexToFields Page" */ 'pages/LogsSettings'),
);
export const BillingPage = Loadable(
() => import(/* webpackChunkName: "BillingPage" */ 'pages/Settings'),
);
export const SupportPage = Loadable(
() => import(/* webpackChunkName: "SupportPage" */ 'pages/Support'),
);
@@ -192,6 +208,10 @@ export const WorkspaceAccessRestricted = Loadable(
),
);
export const ShortcutsPage = Loadable(
() => import(/* webpackChunkName: "ShortcutsPage" */ 'pages/Settings'),
);
export const Integrations = Loadable(
() =>
import(
@@ -210,6 +230,13 @@ export const MessagingQueuesMainPage = Loadable(
import(/* webpackChunkName: "MessagingQueues" */ 'pages/MessagingQueues'),
);
export const MQDetailPage = Loadable(
() =>
import(
/* webpackChunkName: "MQDetailPage" */ 'pages/MessagingQueues/MQDetailPage'
),
);
export const InfrastructureMonitoring = Loadable(
() =>
import(
@@ -217,6 +244,20 @@ export const InfrastructureMonitoring = Loadable(
),
);
export const CeleryTask = Loadable(
() =>
import(
/* webpackChunkName: "CeleryTask" */ 'pages/Celery/CeleryTask/CeleryTask'
),
);
export const CeleryOverview = Loadable(
() =>
import(
/* webpackChunkName: "CeleryOverview" */ 'pages/Celery/CeleryOverview/CeleryOverview'
),
);
export const MetricsExplorer = Loadable(
() =>
import(/* webpackChunkName: "MetricsExplorer" */ 'pages/MetricsExplorer'),

View File

@@ -321,8 +321,8 @@ const createTracesResponse = ({
httpMethod: trace.httpMethod ?? httpMethods[index % httpMethods.length],
responseStatusCode:
trace.responseStatusCode ?? statusCodes[index % statusCodes.length],
trace_id: `trace-id-${index}`,
span_id: `span-id-${index}`,
traceID: `trace-id-${index}`,
spanID: `span-id-${index}`,
},
};
})
@@ -340,8 +340,8 @@ const createTracesResponse = ({
durationNano: 1000000 + cumulativeIndex * 100000,
httpMethod: httpMethods[cumulativeIndex % httpMethods.length],
responseStatusCode: statusCodes[cumulativeIndex % statusCodes.length],
trace_id: `trace-id-${cumulativeIndex}`,
span_id: `span-id-${cumulativeIndex}`,
traceID: `trace-id-${cumulativeIndex}`,
spanID: `span-id-${cumulativeIndex}`,
},
};
},

View File

@@ -19,7 +19,7 @@ export const SIGNOZ_URL_HEADER = 'X-SigNoz-URL';
* needs the originating SigNoz instance URL for multi-tenant deployments;
* when omitted it falls back to its `SIGNOZ_API_URL` env var.
*/
const interceptorsRequestSigNozUrl = (
export const interceptorsRequestSigNozUrl = (
value: InternalAxiosRequestConfig,
): InternalAxiosRequestConfig => {
if (value.headers) {

View File

@@ -11,7 +11,7 @@
* to resume, which each return a new executionId to open a fresh SSE stream.
*
* Types in this file re-use the OpenAPI-generated DTOs in
* `@signozhq/noz-client`.
* `src/api/ai-assistant/sigNozAIAssistantAPI.schemas.ts`.
* Local types are defined only when the UI needs a different shape — for
* example, the SSE event union adds a literal `type` discriminator that the
* generated event DTOs leave loose.
@@ -40,6 +40,7 @@ import type {
CreateThreadResponseDTO,
DoneEventDTO,
ErrorEventDTO,
ExecutionStateDTO,
FeedbackRatingDTO,
ListThreadsApiV1AssistantThreadsGetArchived,
ListThreadsApiV1AssistantThreadsGetParams,
@@ -59,7 +60,7 @@ import type {
PageTypeDTO,
ToolCallEventDTO,
ToolResultEventDTO,
} from '@signozhq/noz-client';
} from './sigNozAIAssistantAPI.schemas';
import { LOCALSTORAGE } from 'constants/localStorage';
import {
@@ -202,6 +203,9 @@ export type SSEEvent =
| (ConversationEventDTO & { type: 'conversation' })
| (DoneEventDTO & { type: 'done' });
/** String-literal view of `ExecutionStateDTO` for ergonomic comparisons. */
export type ExecutionState = `${ExecutionStateDTO}`;
// ---------------------------------------------------------------------------
// Re-exported DTOs — the wire shape, used directly without remapping.
// ---------------------------------------------------------------------------
@@ -397,7 +401,7 @@ async function* readSSEReader(
* Carries the HTTP status so callers can branch on rate-limit vs. other
* failures (e.g. show a "please wait a moment" message on 429).
*/
class SSEStreamError extends Error {
export class SSEStreamError extends Error {
status: number;
constructor(status: number, statusText: string) {

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,34 @@
import axios from 'api';
import { ErrorResponseHandler } from 'api/ErrorResponseHandler';
import { AxiosError } from 'axios';
import convertObjectIntoParams from 'lib/query/convertObjectIntoParams';
import { ErrorResponse, SuccessResponse } from 'types/api';
import { PayloadProps, Props } from 'types/api/alerts/getTriggered';
/**
* @deprecated Use the generated `useGetAlerts` hook (or `getAlerts` fetcher) from
* `api/generated/services/alerts` instead. This hand-written client targets the
* same endpoint and will be removed once call sites migrate.
*
* Part of https://github.com/SigNoz/engineering-pod/issues/5289, add a comment or update when removing this method.
*/
const getTriggered = async (
props: Props,
): Promise<SuccessResponse<PayloadProps> | ErrorResponse> => {
try {
const queryParams = convertObjectIntoParams(props);
const response = await axios.get(`/alerts?${queryParams}`);
return {
statusCode: 200,
error: null,
message: response.data.status,
payload: response.data.data,
};
} catch (error) {
return ErrorResponseHandler(error as AxiosError);
}
};
export default getTriggered;

View File

@@ -40,3 +40,5 @@ export const getFieldKeys = async (
ErrorResponseHandlerV2(error as AxiosError<ErrorV2Resp>);
}
};
export default getFieldKeys;

View File

@@ -93,3 +93,5 @@ export const getFieldValues = async (
ErrorResponseHandlerV2(error as AxiosError<ErrorV2Resp>);
}
};
export default getFieldValues;

View File

@@ -15619,7 +15619,7 @@ export type GetFieldsValuesParams = {
searchText?: string;
/**
* @type string
* @description The key whose values to return, such as service.name. With fieldContext set, it is the stored name as is. Otherwise a context prefix such as resource.service.name sets the context and a type suffix such as service.name:string sets fieldDataType when that is empty; as in filter expressions, a prefixed name also matches a key stored under the full name, whose values come first: log.level returns values of a key named log.level, then of the log field level.
* @description The key whose values to return, such as service.name. A context prefix such as resource.service.name sets fieldContext when it is empty.
*/
name?: string;
/**
@@ -17236,7 +17236,7 @@ export type GetRuleHistoryFilterValuesParams = {
searchText?: string;
/**
* @type string
* @description The key whose values to return, such as service.name. With fieldContext set, it is the stored name as is. Otherwise a context prefix such as resource.service.name sets the context and a type suffix such as service.name:string sets fieldDataType when that is empty; as in filter expressions, a prefixed name also matches a key stored under the full name, whose values come first: log.level returns values of a key named log.level, then of the log field level.
* @description The key whose values to return, such as service.name. A context prefix such as resource.service.name sets fieldContext when it is empty.
*/
name?: string;
/**

View File

@@ -15,6 +15,37 @@ const generatedAPIAxiosInstance = axios.create({
paramsSerializer: { indexes: null },
});
let generatedAPIQueryKeyHeaderContext: Record<string, unknown> | undefined;
export const setGeneratedAPIQueryKeyHeaderContext = <THeaders extends object>(
headers?: THeaders,
): void => {
generatedAPIQueryKeyHeaderContext = headers
? { ...(headers as Record<string, unknown>) }
: undefined;
};
const hashHeaderValue = (value: string): string => {
let hash = 0;
for (let index = 0; index < value.length; index += 1) {
hash = (hash * 31 + value.charCodeAt(index)) >>> 0;
}
return hash.toString(16);
};
const mergeHeaderRecord = (
target: Record<string, unknown>,
source: unknown,
): Record<string, unknown> => {
if (!source || typeof source !== 'object') {
return target;
}
return Object.assign(target, source as Record<string, unknown>);
};
export const GeneratedAPIInstance = <T>(
config: AxiosRequestConfig,
): Promise<T> => {
@@ -29,5 +60,59 @@ generatedAPIAxiosInstance.interceptors.response.use(
interceptorRejected,
);
const getDefaultQueryKeyHeaders = (): Record<string, unknown> => {
const defaults = generatedAPIAxiosInstance.defaults
.headers as unknown as Record<string, unknown>;
const headers: Record<string, unknown> = {};
const methodKeys = new Set([
'common',
'delete',
'get',
'head',
'options',
'patch',
'post',
'put',
]);
mergeHeaderRecord(headers, defaults?.common);
mergeHeaderRecord(headers, defaults?.get);
for (const [key, value] of Object.entries(defaults ?? {})) {
if (!methodKeys.has(key)) {
headers[key] = value;
}
}
return headers;
};
export const getGeneratedAPIQueryKeyHeaders = <THeaders extends object>(
headers?: THeaders,
): [{ headers: Record<string, unknown> }] | [] => {
const mergedHeaders = {
...getDefaultQueryKeyHeaders(),
...generatedAPIQueryKeyHeaderContext,
...(headers as Record<string, unknown> | undefined),
};
const queryKeyHeaders = Object.fromEntries(
Object.entries(mergedHeaders)
.filter(([, value]) => value !== undefined)
.sort(([left], [right]) => left.localeCompare(right))
.map(([key, value]) => {
if (key.toLowerCase() === 'authorization' && typeof value === 'string') {
return [key, hashHeaderValue(value)];
}
return [key, value];
}),
);
return Object.keys(queryKeyHeaders).length
? [{ headers: queryKeyHeaders }]
: [];
};
export type ErrorType<Error> = AxiosError<Error>;
export type BodyType<BodyData> = BodyData;

View File

@@ -179,7 +179,7 @@ instance.interceptors.request.use(interceptorsRequestResponse);
instance.interceptors.request.use(interceptorsRequestBasePath);
instance.interceptors.response.use(interceptorsResponse, interceptorRejected);
const AxiosAlertManagerInstance = axios.create({
export const AxiosAlertManagerInstance = axios.create({
baseURL: `${ENVIRONMENT.baseURL}${apiAlertManager}`,
});
@@ -252,4 +252,5 @@ AxiosAlertManagerInstance.interceptors.response.use(
AxiosAlertManagerInstance.interceptors.request.use(interceptorsRequestResponse);
AxiosAlertManagerInstance.interceptors.request.use(interceptorsRequestBasePath);
export { apiV1 };
export default instance;

View File

@@ -0,0 +1,50 @@
import { ApiV3Instance } from 'api';
import { ErrorResponseHandler } from 'api/ErrorResponseHandler';
import { AxiosError, AxiosResponse } from 'axios';
import { baseAutoCompleteIdKeysOrder } from 'constants/queryBuilder';
import { createIdFromObjectFields } from 'lib/createIdFromObjectFields';
import createQueryParams from 'lib/createQueryParams';
// ** Helpers
import { ErrorResponse, SuccessResponse } from 'types/api';
// ** Types
import { IGetAggregateAttributePayload } from 'types/api/queryBuilder/getAggregatorAttribute';
import {
BaseAutocompleteData,
IQueryAutocompleteResponse,
} from 'types/api/queryBuilder/queryAutocompleteResponse';
export const getAggregateAttribute = async ({
aggregateOperator,
searchText,
dataSource,
source,
}: IGetAggregateAttributePayload): Promise<
SuccessResponse<IQueryAutocompleteResponse> | ErrorResponse
> => {
try {
const response: AxiosResponse<{
data: IQueryAutocompleteResponse;
}> = await ApiV3Instance.get(
`/autocomplete/aggregate_attributes?${createQueryParams({
aggregateOperator,
searchText,
dataSource: source === 'meter' ? 'meter' : dataSource,
})}`,
);
const payload: BaseAutocompleteData[] =
response.data.data.attributeKeys?.map(({ id: _, ...item }) => ({
...item,
id: createIdFromObjectFields(item, baseAutoCompleteIdKeysOrder),
})) || [];
return {
statusCode: 200,
error: null,
message: response.statusText,
payload: { attributeKeys: payload },
};
} catch (e) {
return ErrorResponseHandler(e as AxiosError);
}
};

View File

@@ -0,0 +1,50 @@
import { ApiV3Instance } from 'api';
import { ErrorResponseHandler } from 'api/ErrorResponseHandler';
import { AxiosError, AxiosResponse } from 'axios';
import { baseAutoCompleteIdKeysOrder } from 'constants/queryBuilder';
import { createIdFromObjectFields } from 'lib/createIdFromObjectFields';
import createQueryParams from 'lib/createQueryParams';
import { ErrorResponse, SuccessResponse } from 'types/api';
import { IGetAttributeKeysPayload } from 'types/api/queryBuilder/getAttributeKeys';
import {
BaseAutocompleteData,
IQueryAutocompleteResponse,
} from 'types/api/queryBuilder/queryAutocompleteResponse';
export const getAggregateKeys = async ({
aggregateOperator,
searchText,
dataSource,
aggregateAttribute,
tagType,
}: IGetAttributeKeysPayload): Promise<
SuccessResponse<IQueryAutocompleteResponse> | ErrorResponse
> => {
try {
const response: AxiosResponse<{
data: IQueryAutocompleteResponse;
}> = await ApiV3Instance.get(
`/autocomplete/attribute_keys?${createQueryParams({
aggregateOperator,
searchText,
dataSource,
aggregateAttribute,
})}&tagType=${tagType}`,
);
const payload: BaseAutocompleteData[] =
response.data.data.attributeKeys?.map(({ id: _, ...item }) => ({
...item,
id: createIdFromObjectFields(item, baseAutoCompleteIdKeysOrder),
})) || [];
return {
statusCode: 200,
error: null,
message: response.statusText,
payload: { attributeKeys: payload },
};
} catch (e) {
return ErrorResponseHandler(e as AxiosError);
}
};

View File

@@ -0,0 +1,63 @@
import { ApiV3Instance } from 'api';
import { ErrorResponseHandler } from 'api/ErrorResponseHandler';
import { AxiosError, AxiosResponse } from 'axios';
import { baseAutoCompleteIdKeysOrder } from 'constants/queryBuilder';
import { encode } from 'js-base64';
import { createIdFromObjectFields } from 'lib/createIdFromObjectFields';
import createQueryParams from 'lib/createQueryParams';
import { ErrorResponse, SuccessResponse } from 'types/api';
import {
IGetAttributeSuggestionsPayload,
IGetAttributeSuggestionsSuccessResponse,
} from 'types/api/queryBuilder/getAttributeSuggestions';
import { BaseAutocompleteData } from 'types/api/queryBuilder/queryAutocompleteResponse';
export const getAttributeSuggestions = async ({
searchText,
dataSource,
filters,
}: IGetAttributeSuggestionsPayload): Promise<
SuccessResponse<IGetAttributeSuggestionsSuccessResponse> | ErrorResponse
> => {
try {
let base64EncodedFiltersString;
try {
// the replace function is to remove the padding at the end of base64 encoded string which is auto added to make it a multiple of 4
// why ? because the current working of qs doesn't work well with padding
base64EncodedFiltersString = encode(JSON.stringify(filters)).replace(
/=+$/,
'',
);
} catch {
// default base64 encoded string for empty filters object
base64EncodedFiltersString = 'eyJpdGVtcyI6W10sIm9wIjoiQU5EIn0';
}
const response: AxiosResponse<{
data: IGetAttributeSuggestionsSuccessResponse;
}> = await ApiV3Instance.get(
`/filter_suggestions?${createQueryParams({
searchText,
dataSource,
existingFilter: base64EncodedFiltersString,
})}`,
);
const payload: BaseAutocompleteData[] =
response.data.data.attributes?.map(({ id: _, ...item }) => ({
...item,
id: createIdFromObjectFields(item, baseAutoCompleteIdKeysOrder),
})) || [];
return {
statusCode: 200,
error: null,
message: response.statusText,
payload: {
attributes: payload,
example_queries: response.data.data.example_queries,
},
};
} catch (e) {
return ErrorResponseHandler(e as AxiosError);
}
};

View File

@@ -0,0 +1,42 @@
import { ApiV3Instance } from 'api';
import { ErrorResponseHandler } from 'api/ErrorResponseHandler';
import { AxiosError } from 'axios';
import createQueryParams from 'lib/createQueryParams';
import { ErrorResponse, SuccessResponse } from 'types/api';
import {
IAttributeValuesResponse,
IGetAttributeValuesPayload,
} from 'types/api/queryBuilder/getAttributesValues';
export const getAttributesValues = async ({
aggregateOperator,
dataSource,
aggregateAttribute,
attributeKey,
filterAttributeKeyDataType,
tagType,
searchText,
}: IGetAttributeValuesPayload): Promise<
SuccessResponse<IAttributeValuesResponse> | ErrorResponse
> => {
try {
const response = await ApiV3Instance.get(
`/autocomplete/attribute_values?${createQueryParams({
aggregateOperator,
dataSource,
aggregateAttribute,
attributeKey,
searchText,
})}&filterAttributeKeyDataType=${filterAttributeKeyDataType}&tagType=${tagType}`,
);
return {
statusCode: 200,
error: null,
message: response.data.status,
payload: response.data.data,
};
} catch (error) {
return ErrorResponseHandler(error as AxiosError);
}
};

View File

@@ -0,0 +1,27 @@
import { ApiV2Instance as axios } from 'api';
import { omit } from 'lodash-es';
import { ErrorResponse, SuccessResponse } from 'types/api';
import {
GetTraceFlamegraphPayloadProps,
GetTraceFlamegraphSuccessResponse,
} from 'types/api/trace/getTraceFlamegraph';
const getTraceFlamegraph = async (
props: GetTraceFlamegraphPayloadProps,
): Promise<
SuccessResponse<GetTraceFlamegraphSuccessResponse> | ErrorResponse
> => {
const response = await axios.post<GetTraceFlamegraphSuccessResponse>(
`/traces/flamegraph/${props.traceId}`,
omit(props, 'traceId'),
);
return {
statusCode: 200,
error: null,
message: 'Success',
payload: response.data,
};
};
export default getTraceFlamegraph;

View File

@@ -150,6 +150,15 @@ export const validateFunnelSteps = async (
};
};
export interface UpdateFunnelStepDetailsPayload {
funnel_id: string;
steps: Array<{
step_name: string;
description: string;
}>;
updated_at: number;
}
interface UpdateFunnelDescriptionPayload {
funnel_id: string;
description: string;

View File

@@ -73,3 +73,5 @@ export const downloadExportData = async (
ErrorResponseHandlerV2(error as AxiosError<ErrorV2Resp>);
}
};
export default downloadExportData;

View File

@@ -1,11 +1,24 @@
// V5 Query Range Constants
import { RequestType } from 'types/api/v5/queryRange';
import { ENTITY_VERSION_V5 } from 'constants/app';
import {
FunctionName,
RequestType,
SignalType,
Step,
} from 'types/api/v5/queryRange';
// ===================== Schema and Version Constants =====================
export const SCHEMA_VERSION_V5 = ENTITY_VERSION_V5;
export const API_VERSION_V5 = 'v5';
// ===================== Default Values =====================
export const DEFAULT_STEP_INTERVAL: Step = '60s';
export const DEFAULT_LIMIT = 100;
export const DEFAULT_OFFSET = 0;
// ===================== Request Type Constants =====================
export const REQUEST_TYPES: Record<string, RequestType> = {
@@ -17,14 +30,139 @@ export const REQUEST_TYPES: Record<string, RequestType> = {
// ===================== Signal Type Constants =====================
export const SIGNAL_TYPES: Record<string, SignalType> = {
TRACES: 'traces',
LOGS: 'logs',
METRICS: 'metrics',
} as const;
// ===================== Common Aggregation Expressions =====================
export const TRACE_AGGREGATIONS = {
COUNT: 'count()',
COUNT_DISTINCT_TRACE_ID: 'count_distinct(traceID)',
AVG_DURATION: 'avg(duration_nano)',
P50_DURATION: 'p50(duration_nano)',
P95_DURATION: 'p95(duration_nano)',
P99_DURATION: 'p99(duration_nano)',
MAX_DURATION: 'max(duration_nano)',
MIN_DURATION: 'min(duration_nano)',
SUM_DURATION: 'sum(duration_nano)',
} as const;
export const LOG_AGGREGATIONS = {
COUNT: 'count()',
COUNT_DISTINCT_HOST: 'count_distinct(host.name)',
COUNT_DISTINCT_SERVICE: 'count_distinct(service.name)',
COUNT_DISTINCT_CONTAINER: 'count_distinct(container.name)',
} as const;
// ===================== Common Filter Expressions =====================
export const COMMON_FILTERS = {
// Trace filters
SERVER_SPANS: "kind_string = 'Server'",
CLIENT_SPANS: "kind_string = 'Client'",
INTERNAL_SPANS: "kind_string = 'Internal'",
ERROR_SPANS: 'http.status_code >= 400',
SUCCESS_SPANS: 'http.status_code < 400',
// Common service filters
EXCLUDE_HEALTH_CHECKS: "http.route != '/health' AND http.route != '/ping'",
HTTP_REQUESTS: "http.method != ''",
// Log filters
ERROR_LOGS: "severity_text = 'ERROR'",
WARN_LOGS: "severity_text = 'WARN'",
INFO_LOGS: "severity_text = 'INFO'",
DEBUG_LOGS: "severity_text = 'DEBUG'",
} as const;
// ===================== Common Group By Fields =====================
export const COMMON_GROUP_BY_FIELDS = {
SERVICE_NAME: {
name: 'service.name',
fieldDataType: 'string' as const,
fieldContext: 'resource' as const,
},
HTTP_METHOD: {
name: 'http.method',
fieldDataType: 'string' as const,
fieldContext: 'attribute' as const,
},
HTTP_ROUTE: {
name: 'http.route',
fieldDataType: 'string' as const,
fieldContext: 'attribute' as const,
},
HTTP_STATUS_CODE: {
name: 'http.status_code',
fieldDataType: 'int64' as const,
fieldContext: 'attribute' as const,
},
HOST_NAME: {
name: 'host.name',
fieldDataType: 'string' as const,
fieldContext: 'resource' as const,
},
CONTAINER_NAME: {
name: 'container.name',
fieldDataType: 'string' as const,
fieldContext: 'resource' as const,
},
} as const;
// ===================== Function Names =====================
export const FUNCTION_NAMES: Record<string, FunctionName> = {
CUT_OFF_MIN: 'cutOffMin',
CUT_OFF_MAX: 'cutOffMax',
CLAMP_MIN: 'clampMin',
CLAMP_MAX: 'clampMax',
ABSOLUTE: 'absolute',
RUNNING_DIFF: 'runningDiff',
LOG2: 'log2',
LOG10: 'log10',
CUM_SUM: 'cumulativeSum',
EWMA3: 'ewma3',
EWMA5: 'ewma5',
EWMA7: 'ewma7',
MEDIAN3: 'median3',
MEDIAN5: 'median5',
MEDIAN7: 'median7',
TIME_SHIFT: 'timeShift',
ANOMALY: 'anomaly',
} as const;
// ===================== Common Step Intervals =====================
export const STEP_INTERVALS = {
FIFTEEN_SECONDS: '15s',
THIRTY_SECONDS: '30s',
ONE_MINUTE: '60s',
FIVE_MINUTES: '300s',
TEN_MINUTES: '600s',
FIFTEEN_MINUTES: '900s',
THIRTY_MINUTES: '1800s',
ONE_HOUR: '3600s',
TWO_HOURS: '7200s',
SIX_HOURS: '21600s',
TWELVE_HOURS: '43200s',
ONE_DAY: '86400s',
} as const;
// ===================== Time Range Presets =====================
export const TIME_RANGE_PRESETS = {
LAST_5_MINUTES: 5 * 60 * 1000,
LAST_15_MINUTES: 15 * 60 * 1000,
LAST_30_MINUTES: 30 * 60 * 1000,
LAST_HOUR: 60 * 60 * 1000,
LAST_3_HOURS: 3 * 60 * 60 * 1000,
LAST_6_HOURS: 6 * 60 * 60 * 1000,
LAST_12_HOURS: 12 * 60 * 60 * 1000,
LAST_24_HOURS: 24 * 60 * 60 * 1000,
LAST_3_DAYS: 3 * 24 * 60 * 60 * 1000,
LAST_7_DAYS: 7 * 24 * 60 * 60 * 1000,
} as const;

View File

@@ -48,3 +48,5 @@ export const getQueryRangeV5 = async (
ErrorResponseHandlerV2(error as AxiosError<ErrorV2Resp>);
}
};
export default getQueryRangeV5;

View File

@@ -21,7 +21,6 @@ import { DataSource, ReduceOperators } from 'types/common/queryBuilder';
import {
convertBuilderQueriesToV5,
createAggregation,
mapPanelTypeToRequestType,
prepareQueryRangePayloadV5,
} from './prepareQueryRangePayloadV5';
@@ -1016,47 +1015,3 @@ describe('convertBuilderQueriesToV5 builder query type', () => {
expect(buildEnvelope(builderQueryType, 'trace').type).toBe('builder_query');
});
});
describe('createAggregation fallback', () => {
const logsQuery = (expression: string): Partial<IBuilderQuery> => ({
dataSource: DataSource.LOGS,
aggregations: [{ expression }],
});
it('sends no aggregation for a heatmap with no field', () => {
expect(createAggregation(logsQuery(''), PANEL_TYPES.HEATMAP)).toStrictEqual(
[],
);
});
it('reads a field on a heatmap and turns it into count() elsewhere', () => {
expect(
createAggregation(logsQuery('duration_nano'), PANEL_TYPES.HEATMAP),
).toStrictEqual([{ expression: 'duration_nano' }]);
expect(
createAggregation(logsQuery('duration_nano'), PANEL_TYPES.TIME_SERIES),
).toStrictEqual([{ expression: 'count()' }]);
});
it('still defaults other panels to count()', () => {
expect(
createAggregation(logsQuery(''), PANEL_TYPES.TIME_SERIES),
).toStrictEqual([{ expression: 'count()' }]);
});
it('sends the field of a logs heatmap query', () => {
const [envelope] = convertBuilderQueriesToV5(
{
A: {
...logsQuery('duration_nano'),
queryName: 'A',
} as IBuilderQuery,
},
mapPanelTypeToRequestType(PANEL_TYPES.HEATMAP),
PANEL_TYPES.HEATMAP,
);
expect((envelope.spec as LogBuilderQuery).aggregations).toStrictEqual([
{ expression: 'duration_nano' },
]);
});
});

View File

@@ -5,8 +5,6 @@ import { PANEL_TYPES } from 'constants/queryBuilder';
import { GetQueryResultsProps } from 'lib/dashboard/getQueryResults';
import { foldAISlot } from 'lib/query/builderSlot';
import getStartEndRangeTime from 'lib/getStartEndRangeTime';
import { parseAggregations } from 'lib/query/aggregationExpression';
import { aggregatesDistributionField } from 'lib/query/distributionField';
import { mapQueryDataToApi } from 'lib/newQueryBuilder/queryBuilderMappers/mapQueryDataToApi';
import { isEmpty } from 'lodash-es';
import { DynamicVariableSuggestion } from 'providers/Dashboard/store/dynamicVariableSuggestions';
@@ -242,6 +240,32 @@ function createBaseSpec(
};
}
// Utility to parse aggregation expressions with optional alias
export function parseAggregations(
expression: string,
availableAlias?: string,
): { expression: string; alias?: string }[] {
const result: { expression: string; alias?: string }[] = [];
// Matches function calls like "count()" or "sum(field)" with optional alias like "as 'alias'"
// Handles quoted ('alias'), dash-separated (field-name), and unquoted values after "as" keyword
const regex =
/([a-zA-Z0-9_]+\([^)]*\))(?:\s*as\s+((?:'[^']*'|"[^"]*"|[a-zA-Z0-9_-]+)))?/g;
let match = regex.exec(expression);
while (match !== null) {
const expr = match[1];
let alias = match[2] || availableAlias; // Use provided alias or availableAlias if not matched
if (alias) {
// Remove quotes if present
alias = alias.replace(/^['"]|['"]$/g, '');
result.push({ expression: expr, alias });
} else {
result.push({ expression: expr });
}
match = regex.exec(expression);
}
return result;
}
export function createAggregation(
queryData: any,
panelType?: PANEL_TYPES,
@@ -286,28 +310,18 @@ export function createAggregation(
];
}
// A heatmap buckets the field the user names; count() would be rejected as one.
// Elsewhere a field is not an aggregation, so it falls back to count().
const isDistributionField = aggregatesDistributionField(
panelType,
queryData.dataSource,
);
const fallback = isDistributionField ? [] : [{ expression: 'count()' }];
if (queryData.aggregations?.length > 0) {
return queryData.aggregations.flatMap(
(agg: { expression: string; alias?: string }) => {
const parsedAggregations = parseAggregations(
agg.expression,
agg?.alias,
isDistributionField,
);
return isEmpty(parsedAggregations) ? fallback : parsedAggregations;
const parsedAggregations = parseAggregations(agg.expression, agg?.alias);
return isEmpty(parsedAggregations)
? [{ expression: 'count()' }]
: parsedAggregations;
},
);
}
return fallback;
return [{ expression: 'count()' }];
}
/**

View File

@@ -10,7 +10,7 @@ import { QueryBuilderContextType } from 'types/common/queryBuilder';
import { AppLayer } from './types';
interface AppPageProvidersProps {
export interface AppPageProvidersProps {
children: ReactNode;
layout: AppLayer;
/** When set, replaces `QueryBuilderProvider` with a fixed context value. */

View File

@@ -11,7 +11,7 @@ import TimezoneProvider from 'providers/Timezone';
import { AppLayer } from './types';
interface AppProvidersProps {
export interface AppProvidersProps {
children: ReactNode;
store: Store;
queryClient: QueryClient;

View File

@@ -5,7 +5,7 @@ import { NotificationProvider } from 'hooks/useNotifications';
import { CmdKProvider } from 'providers/cmdKProvider';
import { ErrorModalProvider } from 'providers/ErrorModalProvider';
interface AppShellProps {
export interface AppShellProps {
children: ReactNode;
/** Mounted beside the routed content: the command palette and its siblings. */
overlays?: ReactNode;

View File

@@ -0,0 +1,39 @@
interface SeverityCriticalIconProps {
width?: number;
height?: number;
fill?: string;
stroke?: string;
}
function SeverityCriticalIcon({
width,
height,
fill,
stroke,
}: SeverityCriticalIconProps): JSX.Element {
return (
<svg
width={width}
height={height}
fill={fill}
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M.99707.666056.99707 2.99939M.99707 5.33337H.991237M3.00293.666056 3.00293 2.99939M3.00293 5.33337H2.9971M5.00879.666056V2.99939M5.00879 5.33337H5.00296"
stroke={stroke}
strokeWidth="1.16667"
strokeLinecap="round"
strokeLinejoin="round"
/>
</svg>
);
}
SeverityCriticalIcon.defaultProps = {
width: 6,
height: 6,
fill: 'none',
stroke: '#F56C87',
};
export default SeverityCriticalIcon;

View File

@@ -0,0 +1,42 @@
interface SeverityErrorIconProps {
width?: number;
height?: number;
fill?: string;
stroke?: string;
strokeWidth?: string;
}
function SeverityErrorIcon({
width,
height,
fill,
stroke,
strokeWidth,
}: SeverityErrorIconProps): JSX.Element {
return (
<svg
width={width}
height={height}
fill={fill}
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M1.00781.957845 1.00781 2.99951M1.00781 5.04175H1.00228"
stroke={stroke}
strokeWidth={strokeWidth}
strokeLinecap="round"
strokeLinejoin="round"
/>
</svg>
);
}
SeverityErrorIcon.defaultProps = {
width: 2,
height: 6,
fill: 'none',
stroke: '#F56C87',
strokeWidth: '1.02083',
};
export default SeverityErrorIcon;

View File

@@ -0,0 +1,46 @@
interface SeverityInfoIconProps {
width?: number;
height?: number;
fill?: string;
stroke?: string;
}
function SeverityInfoIcon({
width,
height,
fill,
stroke,
}: SeverityInfoIconProps): JSX.Element {
return (
<svg
width={width}
height={height}
fill={fill}
xmlns="http://www.w3.org/2000/svg"
>
<rect
width={width}
height={height}
rx="3.5"
fill={stroke}
fillOpacity=".2"
/>
<path
d="M7 9.33346V7.00012M7 4.66675H7.00583"
stroke={stroke}
strokeWidth="1.16667"
strokeLinecap="round"
strokeLinejoin="round"
/>
</svg>
);
}
SeverityInfoIcon.defaultProps = {
width: 14,
height: 14,
fill: 'none',
stroke: '#7190F9',
};
export default SeverityInfoIcon;

View File

@@ -0,0 +1,42 @@
interface SeverityWarningIconProps {
width?: number;
height?: number;
fill?: string;
stroke?: string;
strokeWidth?: string;
}
function SeverityWarningIcon({
width,
height,
fill,
stroke,
strokeWidth,
}: SeverityWarningIconProps): JSX.Element {
return (
<svg
width={width}
height={height}
fill={fill}
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M1.00732.957845 1.00732 2.99951M1.00732 5.04175H1.00179"
stroke={stroke}
strokeWidth={strokeWidth}
strokeLinecap="round"
strokeLinejoin="round"
/>
</svg>
);
}
SeverityWarningIcon.defaultProps = {
width: 2,
height: 6,
fill: 'none',
stroke: '#FFD778',
strokeWidth: '0.978299',
};
export default SeverityWarningIcon;

View File

@@ -0,0 +1,17 @@
<svg width="46" height="46" viewBox="0 0 46 46" fill="none" xmlns="http://www.w3.org/2000/svg">
<g filter="url(#filter0_d_2445_31698)">
<circle cx="23" cy="23" r="3" fill="#51E7A8"/>
</g>
<defs>
<filter id="filter0_d_2445_31698" x="0" y="0" width="46" height="46" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset/>
<feGaussianBlur stdDeviation="10"/>
<feComposite in2="hardAlpha" operator="out"/>
<feColorMatrix type="matrix" values="0 0 0 0 0.317647 0 0 0 0 0.905882 0 0 0 0 0.658824 0 0 0 0.6 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_2445_31698"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_2445_31698" result="shape"/>
</filter>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 910 B

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 204 KiB

View File

@@ -0,0 +1,458 @@
<svg
width="1348"
height="8"
viewBox="0 0 1348 8"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<rect width="2" height="2" rx="1" fill="#242834" />
<rect x="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="12" width="2" height="2" rx="1" fill="#242834" />
<rect x="18" width="2" height="2" rx="1" fill="#242834" />
<rect x="24" width="2" height="2" rx="1" fill="#242834" />
<rect x="30" width="2" height="2" rx="1" fill="#242834" />
<rect x="36" width="2" height="2" rx="1" fill="#242834" />
<rect x="42" width="2" height="2" rx="1" fill="#242834" />
<rect x="48" width="2" height="2" rx="1" fill="#242834" />
<rect x="54" width="2" height="2" rx="1" fill="#242834" />
<rect x="60" width="2" height="2" rx="1" fill="#242834" />
<rect x="66" width="2" height="2" rx="1" fill="#242834" />
<rect x="72" width="2" height="2" rx="1" fill="#242834" />
<rect x="78" width="2" height="2" rx="1" fill="#242834" />
<rect x="84" width="2" height="2" rx="1" fill="#242834" />
<rect x="90" width="2" height="2" rx="1" fill="#242834" />
<rect x="96" width="2" height="2" rx="1" fill="#242834" />
<rect x="102" width="2" height="2" rx="1" fill="#242834" />
<rect x="108" width="2" height="2" rx="1" fill="#242834" />
<rect x="114" width="2" height="2" rx="1" fill="#242834" />
<rect x="120" width="2" height="2" rx="1" fill="#242834" />
<rect x="126" width="2" height="2" rx="1" fill="#242834" />
<rect x="132" width="2" height="2" rx="1" fill="#242834" />
<rect x="138" width="2" height="2" rx="1" fill="#242834" />
<rect x="144" width="2" height="2" rx="1" fill="#242834" />
<rect x="150" width="2" height="2" rx="1" fill="#242834" />
<rect x="156" width="2" height="2" rx="1" fill="#242834" />
<rect x="162" width="2" height="2" rx="1" fill="#242834" />
<rect x="168" width="2" height="2" rx="1" fill="#242834" />
<rect x="174" width="2" height="2" rx="1" fill="#242834" />
<rect x="180" width="2" height="2" rx="1" fill="#242834" />
<rect x="186" width="2" height="2" rx="1" fill="#242834" />
<rect x="192" width="2" height="2" rx="1" fill="#242834" />
<rect x="198" width="2" height="2" rx="1" fill="#242834" />
<rect x="204" width="2" height="2" rx="1" fill="#242834" />
<rect x="210" width="2" height="2" rx="1" fill="#242834" />
<rect x="216" width="2" height="2" rx="1" fill="#242834" />
<rect x="222" width="2" height="2" rx="1" fill="#242834" />
<rect x="228" width="2" height="2" rx="1" fill="#242834" />
<rect x="234" width="2" height="2" rx="1" fill="#242834" />
<rect x="240" width="2" height="2" rx="1" fill="#242834" />
<rect x="246" width="2" height="2" rx="1" fill="#242834" />
<rect x="252" width="2" height="2" rx="1" fill="#242834" />
<rect x="258" width="2" height="2" rx="1" fill="#242834" />
<rect x="264" width="2" height="2" rx="1" fill="#242834" />
<rect x="270" width="2" height="2" rx="1" fill="#242834" />
<rect x="276" width="2" height="2" rx="1" fill="#242834" />
<rect x="282" width="2" height="2" rx="1" fill="#242834" />
<rect x="288" width="2" height="2" rx="1" fill="#242834" />
<rect x="294" width="2" height="2" rx="1" fill="#242834" />
<rect x="300" width="2" height="2" rx="1" fill="#242834" />
<rect x="306" width="2" height="2" rx="1" fill="#242834" />
<rect x="312" width="2" height="2" rx="1" fill="#242834" />
<rect x="318" width="2" height="2" rx="1" fill="#242834" />
<rect x="324" width="2" height="2" rx="1" fill="#242834" />
<rect x="330" width="2" height="2" rx="1" fill="#242834" />
<rect x="336" width="2" height="2" rx="1" fill="#242834" />
<rect x="342" width="2" height="2" rx="1" fill="#242834" />
<rect x="348" width="2" height="2" rx="1" fill="#242834" />
<rect x="354" width="2" height="2" rx="1" fill="#242834" />
<rect x="360" width="2" height="2" rx="1" fill="#242834" />
<rect x="366" width="2" height="2" rx="1" fill="#242834" />
<rect x="372" width="2" height="2" rx="1" fill="#242834" />
<rect x="378" width="2" height="2" rx="1" fill="#242834" />
<rect x="384" width="2" height="2" rx="1" fill="#242834" />
<rect x="390" width="2" height="2" rx="1" fill="#242834" />
<rect x="396" width="2" height="2" rx="1" fill="#242834" />
<rect x="402" width="2" height="2" rx="1" fill="#242834" />
<rect x="408" width="2" height="2" rx="1" fill="#242834" />
<rect x="414" width="2" height="2" rx="1" fill="#242834" />
<rect x="420" width="2" height="2" rx="1" fill="#242834" />
<rect x="426" width="2" height="2" rx="1" fill="#242834" />
<rect x="432" width="2" height="2" rx="1" fill="#242834" />
<rect x="438" width="2" height="2" rx="1" fill="#242834" />
<rect x="444" width="2" height="2" rx="1" fill="#242834" />
<rect x="450" width="2" height="2" rx="1" fill="#242834" />
<rect x="456" width="2" height="2" rx="1" fill="#242834" />
<rect x="462" width="2" height="2" rx="1" fill="#242834" />
<rect x="468" width="2" height="2" rx="1" fill="#242834" />
<rect x="474" width="2" height="2" rx="1" fill="#242834" />
<rect x="480" width="2" height="2" rx="1" fill="#242834" />
<rect x="486" width="2" height="2" rx="1" fill="#242834" />
<rect x="492" width="2" height="2" rx="1" fill="#242834" />
<rect x="498" width="2" height="2" rx="1" fill="#242834" />
<rect x="504" width="2" height="2" rx="1" fill="#242834" />
<rect x="510" width="2" height="2" rx="1" fill="#242834" />
<rect x="516" width="2" height="2" rx="1" fill="#242834" />
<rect x="522" width="2" height="2" rx="1" fill="#242834" />
<rect x="528" width="2" height="2" rx="1" fill="#242834" />
<rect x="534" width="2" height="2" rx="1" fill="#242834" />
<rect x="540" width="2" height="2" rx="1" fill="#242834" />
<rect x="546" width="2" height="2" rx="1" fill="#242834" />
<rect x="552" width="2" height="2" rx="1" fill="#242834" />
<rect x="558" width="2" height="2" rx="1" fill="#242834" />
<rect x="564" width="2" height="2" rx="1" fill="#242834" />
<rect x="570" width="2" height="2" rx="1" fill="#242834" />
<rect x="576" width="2" height="2" rx="1" fill="#242834" />
<rect x="582" width="2" height="2" rx="1" fill="#242834" />
<rect x="588" width="2" height="2" rx="1" fill="#242834" />
<rect x="594" width="2" height="2" rx="1" fill="#242834" />
<rect x="600" width="2" height="2" rx="1" fill="#242834" />
<rect x="606" width="2" height="2" rx="1" fill="#242834" />
<rect x="612" width="2" height="2" rx="1" fill="#242834" />
<rect x="618" width="2" height="2" rx="1" fill="#242834" />
<rect x="624" width="2" height="2" rx="1" fill="#242834" />
<rect x="630" width="2" height="2" rx="1" fill="#242834" />
<rect x="636" width="2" height="2" rx="1" fill="#242834" />
<rect x="642" width="2" height="2" rx="1" fill="#242834" />
<rect x="648" width="2" height="2" rx="1" fill="#242834" />
<rect x="654" width="2" height="2" rx="1" fill="#242834" />
<rect x="660" width="2" height="2" rx="1" fill="#242834" />
<rect x="666" width="2" height="2" rx="1" fill="#242834" />
<rect x="672" width="2" height="2" rx="1" fill="#242834" />
<rect x="678" width="2" height="2" rx="1" fill="#242834" />
<rect x="684" width="2" height="2" rx="1" fill="#242834" />
<rect x="690" width="2" height="2" rx="1" fill="#242834" />
<rect x="696" width="2" height="2" rx="1" fill="#242834" />
<rect x="702" width="2" height="2" rx="1" fill="#242834" />
<rect x="708" width="2" height="2" rx="1" fill="#242834" />
<rect x="714" width="2" height="2" rx="1" fill="#242834" />
<rect x="720" width="2" height="2" rx="1" fill="#242834" />
<rect x="726" width="2" height="2" rx="1" fill="#242834" />
<rect x="732" width="2" height="2" rx="1" fill="#242834" />
<rect x="738" width="2" height="2" rx="1" fill="#242834" />
<rect x="744" width="2" height="2" rx="1" fill="#242834" />
<rect x="750" width="2" height="2" rx="1" fill="#242834" />
<rect x="756" width="2" height="2" rx="1" fill="#242834" />
<rect x="762" width="2" height="2" rx="1" fill="#242834" />
<rect x="768" width="2" height="2" rx="1" fill="#242834" />
<rect x="774" width="2" height="2" rx="1" fill="#242834" />
<rect x="780" width="2" height="2" rx="1" fill="#242834" />
<rect x="786" width="2" height="2" rx="1" fill="#242834" />
<rect x="792" width="2" height="2" rx="1" fill="#242834" />
<rect x="798" width="2" height="2" rx="1" fill="#242834" />
<rect x="804" width="2" height="2" rx="1" fill="#242834" />
<rect x="810" width="2" height="2" rx="1" fill="#242834" />
<rect x="816" width="2" height="2" rx="1" fill="#242834" />
<rect x="822" width="2" height="2" rx="1" fill="#242834" />
<rect x="828" width="2" height="2" rx="1" fill="#242834" />
<rect x="834" width="2" height="2" rx="1" fill="#242834" />
<rect x="840" width="2" height="2" rx="1" fill="#242834" />
<rect x="846" width="2" height="2" rx="1" fill="#242834" />
<rect x="852" width="2" height="2" rx="1" fill="#242834" />
<rect x="858" width="2" height="2" rx="1" fill="#242834" />
<rect x="864" width="2" height="2" rx="1" fill="#242834" />
<rect x="870" width="2" height="2" rx="1" fill="#242834" />
<rect x="876" width="2" height="2" rx="1" fill="#242834" />
<rect x="882" width="2" height="2" rx="1" fill="#242834" />
<rect x="888" width="2" height="2" rx="1" fill="#242834" />
<rect x="894" width="2" height="2" rx="1" fill="#242834" />
<rect x="900" width="2" height="2" rx="1" fill="#242834" />
<rect x="906" width="2" height="2" rx="1" fill="#242834" />
<rect x="912" width="2" height="2" rx="1" fill="#242834" />
<rect x="918" width="2" height="2" rx="1" fill="#242834" />
<rect x="924" width="2" height="2" rx="1" fill="#242834" />
<rect x="930" width="2" height="2" rx="1" fill="#242834" />
<rect x="936" width="2" height="2" rx="1" fill="#242834" />
<rect x="942" width="2" height="2" rx="1" fill="#242834" />
<rect x="948" width="2" height="2" rx="1" fill="#242834" />
<rect x="954" width="2" height="2" rx="1" fill="#242834" />
<rect x="960" width="2" height="2" rx="1" fill="#242834" />
<rect x="966" width="2" height="2" rx="1" fill="#242834" />
<rect x="972" width="2" height="2" rx="1" fill="#242834" />
<rect x="978" width="2" height="2" rx="1" fill="#242834" />
<rect x="984" width="2" height="2" rx="1" fill="#242834" />
<rect x="990" width="2" height="2" rx="1" fill="#242834" />
<rect x="996" width="2" height="2" rx="1" fill="#242834" />
<rect x="1002" width="2" height="2" rx="1" fill="#242834" />
<rect x="1008" width="2" height="2" rx="1" fill="#242834" />
<rect x="1014" width="2" height="2" rx="1" fill="#242834" />
<rect x="1020" width="2" height="2" rx="1" fill="#242834" />
<rect x="1026" width="2" height="2" rx="1" fill="#242834" />
<rect x="1032" width="2" height="2" rx="1" fill="#242834" />
<rect x="1038" width="2" height="2" rx="1" fill="#242834" />
<rect x="1044" width="2" height="2" rx="1" fill="#242834" />
<rect x="1050" width="2" height="2" rx="1" fill="#242834" />
<rect x="1056" width="2" height="2" rx="1" fill="#242834" />
<rect x="1062" width="2" height="2" rx="1" fill="#242834" />
<rect x="1068" width="2" height="2" rx="1" fill="#242834" />
<rect x="1074" width="2" height="2" rx="1" fill="#242834" />
<rect x="1080" width="2" height="2" rx="1" fill="#242834" />
<rect x="1086" width="2" height="2" rx="1" fill="#242834" />
<rect x="1092" width="2" height="2" rx="1" fill="#242834" />
<rect x="1098" width="2" height="2" rx="1" fill="#242834" />
<rect x="1104" width="2" height="2" rx="1" fill="#242834" />
<rect x="1110" width="2" height="2" rx="1" fill="#242834" />
<rect x="1116" width="2" height="2" rx="1" fill="#242834" />
<rect x="1122" width="2" height="2" rx="1" fill="#242834" />
<rect x="1128" width="2" height="2" rx="1" fill="#242834" />
<rect x="1134" width="2" height="2" rx="1" fill="#242834" />
<rect x="1140" width="2" height="2" rx="1" fill="#242834" />
<rect x="1146" width="2" height="2" rx="1" fill="#242834" />
<rect x="1152" width="2" height="2" rx="1" fill="#242834" />
<rect x="1158" width="2" height="2" rx="1" fill="#242834" />
<rect x="1164" width="2" height="2" rx="1" fill="#242834" />
<rect x="1170" width="2" height="2" rx="1" fill="#242834" />
<rect x="1176" width="2" height="2" rx="1" fill="#242834" />
<rect x="1182" width="2" height="2" rx="1" fill="#242834" />
<rect x="1188" width="2" height="2" rx="1" fill="#242834" />
<rect x="1194" width="2" height="2" rx="1" fill="#242834" />
<rect x="1200" width="2" height="2" rx="1" fill="#242834" />
<rect x="1206" width="2" height="2" rx="1" fill="#242834" />
<rect x="1212" width="2" height="2" rx="1" fill="#242834" />
<rect x="1218" width="2" height="2" rx="1" fill="#242834" />
<rect x="1224" width="2" height="2" rx="1" fill="#242834" />
<rect x="1230" width="2" height="2" rx="1" fill="#242834" />
<rect x="1236" width="2" height="2" rx="1" fill="#242834" />
<rect x="1242" width="2" height="2" rx="1" fill="#242834" />
<rect x="1248" width="2" height="2" rx="1" fill="#242834" />
<rect x="1254" width="2" height="2" rx="1" fill="#242834" />
<rect x="1260" width="2" height="2" rx="1" fill="#242834" />
<rect x="1266" width="2" height="2" rx="1" fill="#242834" />
<rect x="1272" width="2" height="2" rx="1" fill="#242834" />
<rect x="1278" width="2" height="2" rx="1" fill="#242834" />
<rect x="1284" width="2" height="2" rx="1" fill="#242834" />
<rect x="1290" width="2" height="2" rx="1" fill="#242834" />
<rect x="1296" width="2" height="2" rx="1" fill="#242834" />
<rect x="1302" width="2" height="2" rx="1" fill="#242834" />
<rect x="1308" width="2" height="2" rx="1" fill="#242834" />
<rect x="1314" width="2" height="2" rx="1" fill="#242834" />
<rect x="1320" width="2" height="2" rx="1" fill="#242834" />
<rect x="1326" width="2" height="2" rx="1" fill="#242834" />
<rect x="1332" width="2" height="2" rx="1" fill="#242834" />
<rect x="1338" width="2" height="2" rx="1" fill="#242834" />
<rect x="1344" width="2" height="2" rx="1" fill="#242834" />
<rect y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="6" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="12" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="18" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="24" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="30" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="36" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="42" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="48" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="54" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="60" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="66" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="72" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="78" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="84" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="90" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="96" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="102" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="108" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="114" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="120" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="126" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="132" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="138" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="144" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="150" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="156" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="162" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="168" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="174" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="180" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="186" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="192" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="198" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="204" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="210" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="216" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="222" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="228" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="234" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="240" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="246" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="252" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="258" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="264" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="270" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="276" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="282" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="288" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="294" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="300" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="306" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="312" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="318" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="324" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="330" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="336" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="342" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="348" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="354" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="360" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="366" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="372" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="378" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="384" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="390" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="396" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="402" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="408" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="414" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="420" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="426" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="432" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="438" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="444" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="450" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="456" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="462" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="468" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="474" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="480" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="486" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="492" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="498" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="504" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="510" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="516" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="522" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="528" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="534" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="540" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="546" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="552" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="558" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="564" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="570" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="576" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="582" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="588" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="594" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="600" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="606" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="612" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="618" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="624" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="630" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="636" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="642" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="648" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="654" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="660" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="666" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="672" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="678" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="684" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="690" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="696" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="702" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="708" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="714" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="720" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="726" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="732" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="738" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="744" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="750" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="756" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="762" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="768" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="774" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="780" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="786" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="792" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="798" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="804" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="810" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="816" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="822" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="828" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="834" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="840" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="846" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="852" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="858" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="864" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="870" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="876" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="882" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="888" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="894" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="900" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="906" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="912" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="918" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="924" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="930" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="936" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="942" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="948" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="954" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="960" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="966" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="972" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="978" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="984" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="990" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="996" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1002" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1008" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1014" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1020" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1026" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1032" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1038" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1044" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1050" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1056" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1062" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1068" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1074" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1080" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1086" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1092" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1098" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1104" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1110" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1116" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1122" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1128" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1134" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1140" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1146" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1152" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1158" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1164" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1170" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1176" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1182" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1188" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1194" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1200" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1206" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1212" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1218" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1224" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1230" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1236" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1242" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1248" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1254" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1260" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1266" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1272" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1278" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1284" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1290" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1296" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1302" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1308" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1314" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1320" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1326" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1332" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1338" y="6" width="2" height="2" rx="1" fill="#242834" />
<rect x="1344" y="6" width="2" height="2" rx="1" fill="#242834" />
</svg>

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 1.7 MiB

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 565.65 130.02"><defs><style>.cls-1{fill:#17181a;}.cls-2{fill:#f15931;}.cls-3{fill:#f9f2f8;}</style></defs><g id="Layer_2" data-name="Layer 2"><g id="Layer_1-2" data-name="Layer 1"><path class="cls-1" d="M157.17,97.54q-7.86-7.79-7.85-21.71h17.22q0,6.58,3.35,10.32t9.31,3.73h14.06a15.93,15.93,0,0,0,9.05-2.34,7.22,7.22,0,0,0,3.48-6.27V77q0-6.21-9.12-7.73l-23.29-3.92Q162,63.42,156.09,58A17.81,17.81,0,0,1,150.2,44.3V37.21a20.09,20.09,0,0,1,3.61-11.84,23.11,23.11,0,0,1,10.26-7.92,39.67,39.67,0,0,1,15.38-2.78h14.31a30.14,30.14,0,0,1,14.56,3.42,24.37,24.37,0,0,1,9.82,9.56,28.37,28.37,0,0,1,3.48,14.24H204.4a12.27,12.27,0,0,0-2.92-8.55,9.89,9.89,0,0,0-7.72-3.22H179.45a14.51,14.51,0,0,0-8.54,2.28,7.05,7.05,0,0,0-3.23,6.07v3.42q0,6.33,8.73,7.85l23.18,4q11.52,2,17.6,7.16a16.52,16.52,0,0,1,6.07,13.23v8.36a19.86,19.86,0,0,1-3.73,11.9,24.08,24.08,0,0,1-10.45,8,39.54,39.54,0,0,1-15.57,2.85H179Q165,105.33,157.17,97.54Z"/><path class="cls-1" d="M237.89,32.33a9.93,9.93,0,0,1-3-7.53,10,10,0,0,1,3-7.54,12.42,12.42,0,0,1,15.83,0,10,10,0,0,1,3,7.54,10,10,0,0,1-3,7.53,12.42,12.42,0,0,1-15.83,0Zm-.7,8.8h17.22v63.19H237.19Z"/><path class="cls-1" d="M279.1,124.26a21.43,21.43,0,0,1-7.47-15.13h17a6.41,6.41,0,0,0,2.28,4.49,7.58,7.58,0,0,0,5.06,1.71h11.4a7.65,7.65,0,0,0,6.39-3.23,13.46,13.46,0,0,0,2.47-8.42v-6a18.47,18.47,0,0,1-6.14,4.43,16.59,16.59,0,0,1-6.9,1.65h-8.74q-11.52,0-18.55-6.84t-7-18V66.08a27.41,27.41,0,0,1,3.3-13.62,22.83,22.83,0,0,1,9.24-9.11,28.27,28.27,0,0,1,13.68-3.23h7.34a18.87,18.87,0,0,1,8.42,2,18.64,18.64,0,0,1,6.65,5.31V41.13h15.95v62.55a28.43,28.43,0,0,1-3.23,13.81,22.81,22.81,0,0,1-9.18,9.24A27.79,27.79,0,0,1,307.34,130h-11.4Q285.82,130,279.1,124.26Zm25.2-35a10.11,10.11,0,0,0,8.1-4,18.2,18.2,0,0,0,3.8-10.45V66.08A13.26,13.26,0,0,0,312.78,58a9.76,9.76,0,0,0-7.34-3h-8.86a9.5,9.5,0,0,0-7.6,3.42,13.4,13.4,0,0,0-2.91,9V77.73a12.55,12.55,0,0,0,2.65,8.35,8.55,8.55,0,0,0,6.84,3.17Z"/><path class="cls-1" d="M348.62,15.68h15.57L406.73,76V15.68h17.1v88.64H408.26L365.71,44v60.28H348.62Z"/><path class="cls-1" d="M449.34,102.23a22.51,22.51,0,0,1-9.49-8.8,25.45,25.45,0,0,1-3.36-13.17V65.44a25.42,25.42,0,0,1,3.42-13.23,23.29,23.29,0,0,1,9.56-8.93,30.5,30.5,0,0,1,14.12-3.16H475a30.5,30.5,0,0,1,14.12,3.16,23.35,23.35,0,0,1,9.56,8.93,25.42,25.42,0,0,1,3.42,13.23V80.26a25.1,25.1,0,0,1-3.42,13.17,23,23,0,0,1-9.56,8.8,31.14,31.14,0,0,1-14.24,3.1h-11.4A30.86,30.86,0,0,1,449.34,102.23ZM474.6,90.52a9.37,9.37,0,0,0,7.47-3.23,12.43,12.43,0,0,0,2.79-8.42V66.58a12.43,12.43,0,0,0-2.79-8.42,9.21,9.21,0,0,0-7.34-3.23H463.84a9.21,9.21,0,0,0-7.34,3.23,12.43,12.43,0,0,0-2.79,8.42V78.87a12.43,12.43,0,0,0,2.79,8.42,9.08,9.08,0,0,0,7.21,3.23Z"/><path class="cls-1" d="M506.89,95.71l34.19-40H508.41V41.13h57.24v8.61l-34.19,40H565v14.56H506.89Z"/><path class="cls-2" d="M61.1,119.86C27.16,119.86,0,93.22,0,59.93,0,27,27.16,0,61.1,0H99.46a22.17,22.17,0,0,1,22.4,22v38C121.86,93.22,94.71,119.86,61.1,119.86Z"/><path class="cls-3" d="M60.62,34C35.27,34,21,55,20.39,55.87a6.53,6.53,0,0,0,0,7.26C21,64,35.27,85,60.62,85s39.64-21,40.23-21.89a6.51,6.51,0,0,0,0-7.25C100.26,55,86,34,60.62,34ZM23.9,60.79a2.33,2.33,0,0,1,0-2.58c.48-.72,10.65-15.65,28.83-19.24a22,22,0,0,0,0,41.05C34.55,76.44,24.38,61.5,23.9,60.79ZM50.49,59.5a2.11,2.11,0,0,1-4.22,0A14.36,14.36,0,0,1,60.62,45.15a2.11,2.11,0,1,1,0,4.21A10.14,10.14,0,0,0,50.49,59.5Zm10.13,5.13a5.13,5.13,0,1,1,5.13-5.13A5.13,5.13,0,0,1,60.62,64.63Zm36.72-3.84C96.86,61.5,86.7,76.44,68.52,80a22,22,0,0,0,0-41C86.7,42.56,96.86,57.49,97.34,58.21A2.29,2.29,0,0,1,97.34,60.79Z"/></g></g></svg>

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 565.65 130.02"><defs><style>.cls-1{fill:#fff;}.cls-2{fill:#f15931;}.cls-3{fill:#f9f2f8;}</style></defs><g id="Layer_2" data-name="Layer 2"><g id="Layer_1-2" data-name="Layer 1"><path class="cls-1" d="M157.17,97.54q-7.86-7.79-7.85-21.71h17.22q0,6.58,3.35,10.32t9.31,3.73h14.06a15.93,15.93,0,0,0,9.05-2.34,7.22,7.22,0,0,0,3.48-6.27V77q0-6.21-9.12-7.73l-23.29-3.92Q162,63.42,156.09,58A17.81,17.81,0,0,1,150.2,44.3V37.21a20.09,20.09,0,0,1,3.61-11.84,23.11,23.11,0,0,1,10.26-7.92,39.67,39.67,0,0,1,15.38-2.78h14.31a30.14,30.14,0,0,1,14.56,3.42,24.37,24.37,0,0,1,9.82,9.56,28.37,28.37,0,0,1,3.48,14.24H204.4a12.27,12.27,0,0,0-2.92-8.55,9.89,9.89,0,0,0-7.72-3.22H179.45a14.51,14.51,0,0,0-8.54,2.28,7.05,7.05,0,0,0-3.23,6.07v3.42q0,6.33,8.73,7.85l23.18,4q11.52,2,17.6,7.16a16.52,16.52,0,0,1,6.07,13.23v8.36a19.86,19.86,0,0,1-3.73,11.9,24.08,24.08,0,0,1-10.45,8,39.54,39.54,0,0,1-15.57,2.85H179Q165,105.33,157.17,97.54Z"/><path class="cls-1" d="M237.89,32.33a9.93,9.93,0,0,1-3-7.53,10,10,0,0,1,3-7.54,12.42,12.42,0,0,1,15.83,0,10,10,0,0,1,3,7.54,10,10,0,0,1-3,7.53,12.42,12.42,0,0,1-15.83,0Zm-.7,8.8h17.22v63.19H237.19Z"/><path class="cls-1" d="M279.1,124.26a21.43,21.43,0,0,1-7.47-15.13h17a6.41,6.41,0,0,0,2.28,4.49,7.58,7.58,0,0,0,5.06,1.71h11.4a7.65,7.65,0,0,0,6.39-3.23,13.46,13.46,0,0,0,2.47-8.42v-6a18.47,18.47,0,0,1-6.14,4.43,16.59,16.59,0,0,1-6.9,1.65h-8.74q-11.52,0-18.55-6.84t-7-18V66.08a27.41,27.41,0,0,1,3.3-13.62,22.83,22.83,0,0,1,9.24-9.11,28.27,28.27,0,0,1,13.68-3.23h7.34a18.87,18.87,0,0,1,8.42,2,18.64,18.64,0,0,1,6.65,5.31V41.13h15.95v62.55a28.43,28.43,0,0,1-3.23,13.81,22.81,22.81,0,0,1-9.18,9.24A27.79,27.79,0,0,1,307.34,130h-11.4Q285.82,130,279.1,124.26Zm25.2-35a10.11,10.11,0,0,0,8.1-4,18.2,18.2,0,0,0,3.8-10.45V66.08A13.26,13.26,0,0,0,312.78,58a9.76,9.76,0,0,0-7.34-3h-8.86a9.5,9.5,0,0,0-7.6,3.42,13.4,13.4,0,0,0-2.91,9V77.73a12.55,12.55,0,0,0,2.65,8.35,8.55,8.55,0,0,0,6.84,3.17Z"/><path class="cls-1" d="M348.62,15.68h15.57L406.73,76V15.68h17.1v88.64H408.26L365.71,44v60.28H348.62Z"/><path class="cls-1" d="M449.34,102.23a22.51,22.51,0,0,1-9.49-8.8,25.45,25.45,0,0,1-3.36-13.17V65.44a25.42,25.42,0,0,1,3.42-13.23,23.29,23.29,0,0,1,9.56-8.93,30.5,30.5,0,0,1,14.12-3.16H475a30.5,30.5,0,0,1,14.12,3.16,23.35,23.35,0,0,1,9.56,8.93,25.42,25.42,0,0,1,3.42,13.23V80.26a25.1,25.1,0,0,1-3.42,13.17,23,23,0,0,1-9.56,8.8,31.14,31.14,0,0,1-14.24,3.1h-11.4A30.86,30.86,0,0,1,449.34,102.23ZM474.6,90.52a9.37,9.37,0,0,0,7.47-3.23,12.43,12.43,0,0,0,2.79-8.42V66.58a12.43,12.43,0,0,0-2.79-8.42,9.21,9.21,0,0,0-7.34-3.23H463.84a9.21,9.21,0,0,0-7.34,3.23,12.43,12.43,0,0,0-2.79,8.42V78.87a12.43,12.43,0,0,0,2.79,8.42,9.08,9.08,0,0,0,7.21,3.23Z"/><path class="cls-1" d="M506.89,95.71l34.19-40H508.41V41.13h57.24v8.61l-34.19,40H565v14.56H506.89Z"/><path class="cls-2" d="M61.1,119.86C27.16,119.86,0,93.22,0,59.93,0,27,27.16,0,61.1,0H99.46a22.17,22.17,0,0,1,22.4,22v38C121.86,93.22,94.71,119.86,61.1,119.86Z"/><path class="cls-3" d="M60.62,34C35.27,34,21,55,20.39,55.87a6.53,6.53,0,0,0,0,7.26C21,64,35.27,85,60.62,85s39.64-21,40.23-21.89a6.51,6.51,0,0,0,0-7.25C100.26,55,86,34,60.62,34ZM23.9,60.79a2.33,2.33,0,0,1,0-2.58c.48-.72,10.65-15.65,28.83-19.24a22,22,0,0,0,0,41.05C34.55,76.44,24.38,61.5,23.9,60.79ZM50.49,59.5a2.11,2.11,0,0,1-4.22,0A14.36,14.36,0,0,1,60.62,45.15a2.11,2.11,0,1,1,0,4.21A10.14,10.14,0,0,0,50.49,59.5Zm10.13,5.13a5.13,5.13,0,1,1,5.13-5.13A5.13,5.13,0,0,1,60.62,64.63Zm36.72-3.84C96.86,61.5,86.7,76.44,68.52,80a22,22,0,0,0,0-41C86.7,42.56,96.86,57.49,97.34,58.21A2.29,2.29,0,0,1,97.34,60.79Z"/></g></g></svg>

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@@ -12,5 +12,4 @@
import '@signozhq/design-tokens';
import '@signozhq/icons';
import '@signozhq/noz-client';
import '@signozhq/ui';

View File

@@ -4,7 +4,7 @@ import { Divider } from '@signozhq/ui/divider';
import styles from './AlertBreadcrumb.module.scss';
import BreadcrumbItem, { BreadcrumbItemConfig } from './BreadcrumbItem';
interface AlertBreadcrumbProps {
export interface AlertBreadcrumbProps {
items: BreadcrumbItemConfig[];
className?: string;
showDivider?: boolean;

View File

@@ -1 +1,6 @@
export { default } from './AlertBreadcrumb';
export {
default as BreadcrumbItem,
type BreadcrumbItemConfig,
} from './BreadcrumbItem';
export type { AlertBreadcrumbProps } from './AlertBreadcrumb';

View File

@@ -29,6 +29,33 @@
min-width: 0;
}
.overflowTrigger {
all: unset;
cursor: pointer;
}
.labelPopover {
display: flex;
flex-direction: column;
gap: 6px;
padding: 8px;
max-height: 300px;
overflow-y: auto;
}
.labelTooltip {
display: flex;
flex-direction: column;
gap: 6px;
max-height: 300px;
overflow-y: auto;
}
.labelValue {
text-overflow: ellipsis;
overflow: hidden;
}
.tooltipContent {
display: flex;
align-items: center;

View File

@@ -11,7 +11,7 @@ import LabelTag from './LabelTag';
import styles from './LabelColumn.module.scss';
import { getVisibleCount } from './utils';
interface LabelColumnProps {
export interface LabelColumnProps {
labels: string[];
color?: BadgeColorType;
value?: { [key: string]: string };

View File

@@ -6,7 +6,7 @@ import { useCopyToClipboard } from 'react-use';
import styles from './LabelTag.module.scss';
interface LabelTagProps {
export interface LabelTagProps {
label: string;
color?: BadgeColorType;
value?: string;

View File

@@ -1 +1,2 @@
export { default } from './LabelColumn';
export type { LabelColumnProps } from './LabelColumn';

View File

@@ -1,4 +1,4 @@
const OVERFLOW_BADGE_WIDTH = 40;
export const OVERFLOW_BADGE_WIDTH = 40;
/**
* How many leading labels fit in `available` px, reserving room for the `+N` badge

View File

@@ -1,5 +1,29 @@
import type { BadgeColorType } from '@signozhq/ui/badge';
export const STATE_ORDER = ['firing', 'pending', 'inactive', 'disabled'];
export const SEVERITY_ORDER = ['critical', 'error', 'warning', 'info'];
export const STATE_LABELS: Record<string, string> = {
firing: 'Firing',
pending: 'Pending',
inactive: 'OK',
disabled: 'Disabled',
};
export const STATE_COLORS: Record<string, string> = {
firing: 'var(--bg-cherry-500)',
pending: 'var(--bg-amber-500)',
inactive: 'var(--bg-forest-500)',
disabled: 'var(--l2-foreground)',
};
export const SEVERITY_COLORS: Record<string, string> = {
critical: 'var(--bg-cherry-500)',
error: 'var(--bg-cherry-400)',
warning: 'var(--bg-amber-500)',
info: 'var(--bg-robin-500)',
};
export const SEVERITY_BADGE_COLORS: Record<string, BadgeColorType> = {
critical: 'danger',
error: 'danger',

View File

@@ -33,6 +33,10 @@
.brand-tagline {
margin-bottom: 24px;
.ant-typography {
color: var(--l2-foreground); // Secondary text
}
}
/* HTML: <div class="loader"></div> */

View File

@@ -7,7 +7,7 @@ import { isModifierKeyPressed } from 'utils/app';
import styles from './BackHeader.module.scss';
interface BackHeaderProps {
export interface BackHeaderProps {
/** Where the page came from, named as the place rather than the action. */
backLabel: string;
backRoute: string;

View File

@@ -57,5 +57,9 @@
.ant-drawer-footer {
border-top: 1px solid var(--l1-border);
.footer-text {
color: var(--l2-foreground);
}
}
}

View File

@@ -18,7 +18,7 @@ import { useNavigateToExplorer } from '../useNavigateToExplorer';
import './CeleryTaskDetail.style.scss';
type CeleryTaskData = {
export type CeleryTaskData = {
entity: string;
value: string | number;
timeRange: [number, number];

View File

@@ -141,6 +141,10 @@
border-radius: 4px;
padding: 6px 24px 6px 12px;
width: max-content;
.configure-option-Info-text {
color: var(--l2-foreground);
}
}
.row-panel {
@@ -153,6 +157,11 @@
height: 48px !important;
width: 100%;
.ant-typography {
font-size: 14px;
font-weight: 500;
}
.row-panel-section {
display: flex;
gap: 6px;

View File

@@ -41,7 +41,7 @@ interface TabData {
key: string;
}
enum CeleryTaskGraphState {
export enum CeleryTaskGraphState {
P99 = 'p99',
P95 = 'p95',
P90 = 'p90',

View File

@@ -9,7 +9,7 @@ import SyntaxHighlighter, {
import styles from './CodeBlock.module.scss';
interface CodeBlockProps {
export interface CodeBlockProps {
code: string;
language?: string;
className?: string;

View File

@@ -21,4 +21,9 @@
line-height: var(--paragraph-small-400-line-height);
margin: 0;
}
&__helper {
color: var(--l3-foreground);
margin: calc(var(--spacing-2) * -1) 0 var(--spacing-4) 0;
}
}

View File

@@ -67,6 +67,21 @@
color: var(--bg-cherry-400) !important;
}
.info-text {
display: flex;
align-items: center;
justify-content: center;
padding: 4px;
cursor: default;
color: var(--l2-foreground) !important;
}
.info-text:hover {
&.ant-btn-text {
background-color: unset !important;
}
}
.date-time-popover__footer {
border-top: 1px solid var(--l1-border);
padding: 8px 14px;

View File

@@ -24,4 +24,10 @@
gap: 4px;
flex-shrink: 0;
}
&__nav {
display: flex;
align-items: center;
gap: 2px;
}
}

View File

@@ -9,7 +9,7 @@ export interface HeaderAction {
component: ReactNode; // check later if we can use direct btn itself or not.
}
interface DetailsHeaderProps {
export interface DetailsHeaderProps {
title: string;
onClose: () => void;
actions?: HeaderAction[];

View File

@@ -1,4 +1,8 @@
export type { HeaderAction } from './DetailsHeader/DetailsHeader';
export type {
DetailsHeaderProps,
HeaderAction,
} from './DetailsHeader/DetailsHeader';
export { default as DetailsHeader } from './DetailsHeader/DetailsHeader';
export { default as DetailsPanelDrawer } from './DetailsPanelDrawer';
export type { DetailsPanelState, UseDetailsPanelOptions } from './types';
export { default as useDetailsPanel } from './useDetailsPanel';

View File

@@ -771,11 +771,7 @@ describe('EditMemberDrawer', () => {
it('keeps roles editable', async () => {
renderDrawer({ member: selfMember });
await expect(
screen.findByTestId(
`member-roles-select-chip-${managedRoles[0].id}-remove`,
),
).resolves.toBeInTheDocument();
await expect(screen.findByText('Select roles')).resolves.toBeInTheDocument();
expect(screen.queryByTestId('member-roles-locked')).not.toBeInTheDocument();
});
});

View File

@@ -1 +1,2 @@
export type { WithErrorBoundaryOptions } from './withErrorBoundary';
export { default as withErrorBoundary } from './withErrorBoundary';

View File

@@ -20,7 +20,7 @@
display: flex;
flex-direction: column;
// radio option labels — popover content inherits the root font
// radio option labels — radix popover content inherits the root font
// size; pin to the app's 13px base the antd popover used to impose
label {
font-size: var(--label-base-400-font-size);

View File

@@ -12,7 +12,7 @@ export type IntersectionCursorPluginOptions = {
gapSize?: number;
};
const defaultIntersectionCursorPluginOptions: Required<IntersectionCursorPluginOptions> =
export const defaultIntersectionCursorPluginOptions: Required<IntersectionCursorPluginOptions> =
{
color: 'white',
dashSize: 3,

View File

@@ -11,6 +11,12 @@
gap: 4px;
}
.header-ai-assistant-btn__prefix {
display: inline-flex;
align-items: center;
gap: 6px;
}
.header-ai-assistant-btn__badge {
flex-shrink: 0;
display: inline-flex;
@@ -124,6 +130,13 @@
resize: none;
}
}
.feedback-content-include-console-logs {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
}
}
.feedback-modal-content-footer {

View File

@@ -0,0 +1,60 @@
.host-containers {
gap: 24px;
height: 60vh;
display: flex;
align-items: center;
justify-content: center;
width: 100%;
margin: 0 auto;
box-sizing: border-box;
.infra-container-card-container {
display: flex;
flex-direction: column;
gap: 24px;
}
.dev-status-container {
display: flex;
flex-direction: column;
gap: 12px;
}
.infra-container-card {
display: flex;
flex-direction: column;
justify-content: center;
}
.infra-container-card-text {
font-size: var(--paragraph-base-400-font-size);
color: var(--l2-foreground);
line-height: 20px;
letter-spacing: -0.07px;
width: 400px;
font-family: 'Inter';
margin-top: 12px;
font-weight: 300;
}
.infra-container-working-msg {
display: flex;
width: 400px;
padding: 12px;
align-items: flex-start;
gap: 12px;
border-radius: 4px;
background: color-mix(in srgb, var(--bg-robin-200) 4%, transparent);
.ant-space {
align-items: flex-start;
}
}
.infra-container-contact-support-btn {
display: flex;
align-items: center;
justify-content: center;
margin: auto;
}
}

View File

@@ -0,0 +1,60 @@
.host-processes {
gap: 24px;
height: 60vh;
display: flex;
align-items: center;
justify-content: center;
width: 100%;
margin: 0 auto;
box-sizing: border-box;
.infra-container-card-container {
display: flex;
flex-direction: column;
gap: 24px;
}
.dev-status-container {
display: flex;
flex-direction: column;
gap: 12px;
}
.infra-container-card {
display: flex;
flex-direction: column;
justify-content: center;
}
.infra-container-card-text {
font-size: var(--paragraph-base-400-font-size);
color: var(--l2-foreground);
line-height: 20px;
letter-spacing: -0.07px;
width: 400px;
font-family: 'Inter';
margin-top: 12px;
font-weight: 300;
}
.infra-container-working-msg {
display: flex;
width: 400px;
padding: 12px;
align-items: flex-start;
gap: 12px;
border-radius: 4px;
background: color-mix(in srgb, var(--bg-robin-200) 4%, transparent);
.ant-space {
align-items: flex-start;
}
}
.infra-container-contact-support-btn {
display: flex;
align-items: center;
justify-content: center;
margin: auto;
}
}

View File

@@ -0,0 +1,15 @@
.wait-list-container {
display: flex;
flex-direction: column;
gap: 8px;
.wait-list-text {
font-weight: 300;
}
.join-waitlist-btn {
width: 160px;
border-radius: 2px;
background: var(--slate-500);
}
}

View File

@@ -0,0 +1,83 @@
import { useState } from 'react';
import { useTranslation } from 'react-i18next';
import { Color } from '@signozhq/design-tokens';
import { Button } from 'antd';
import { Typography } from '@signozhq/ui/typography';
import logEvent from 'api/common/logEvent';
import { useNotifications } from 'hooks/useNotifications';
import { CircleCheckBig, HandPlatter } from '@signozhq/icons';
import { useAppContext } from 'providers/App/App';
import './WaitListFragment.styles.scss';
export default function WaitlistFragment({
entityType,
}: {
entityType: string;
}): JSX.Element {
const { user } = useAppContext();
const { t } = useTranslation(['infraMonitoring']);
const { notifications } = useNotifications();
const [isSubmitting, setIsSubmitting] = useState(false);
const [isSuccess, setIsSuccess] = useState(false);
const handleJoinWaitlist = (): void => {
if (!user || !user.email) {
return;
}
setIsSubmitting(true);
logEvent('Infra Monitoring: Get early access clicked', {
entityType,
userEmail: user.email,
})
.then(() => {
notifications.success({
message: t('waitlist_success_message'),
});
setIsSubmitting(false);
setIsSuccess(true);
setTimeout(() => {
setIsSuccess(false);
}, 4000);
})
.catch((error) => {
console.error('Error logging event:', error);
});
};
return (
<div className="wait-list-container">
<Typography
variant="paragraph"
size="base"
weight="regular"
color="inherit"
as="span"
textOverflow="wrap"
>
{t('waitlist_message')}
</Typography>
<Button
className="periscope-btn join-waitlist-btn"
type="default"
loading={isSubmitting}
icon={
isSuccess ? (
<CircleCheckBig size={16} color={Color.BG_FOREST_500} />
) : (
<HandPlatter size={16} />
)
}
onClick={handleJoinWaitlist}
>
Get early access
</Button>
</div>
);
}

View File

@@ -87,6 +87,10 @@
justify-content: center;
}
.errorText {
color: var(--danger-background);
}
.addRow {
display: flex;
justify-content: flex-start;

View File

@@ -2,7 +2,6 @@ import { rest, server } from 'mocks-server/server';
import { render, screen, userEvent, waitFor } from 'tests/test-utils';
import InviteMembers from '../InviteMembers';
import { InviteMembersProps } from '../types';
import { pickRole } from './roleSelectUtils';
import {
@@ -10,12 +9,9 @@ import {
createErrorHandler,
createRolesHandler,
createSuccessHandler,
enterInviteEmail,
VALID_EMAIL,
} from './testUtils';
type InviteCallback = Required<InviteMembersProps>['onSuccess'];
describe('InviteMembers - Edge Cases', () => {
beforeEach(() => {
server.use(createRolesHandler(), createSuccessHandler());
@@ -27,7 +23,7 @@ describe('InviteMembers - Edge Cases', () => {
describe('reset behavior', () => {
it('clears all rows when reset is called', async () => {
const user = userEvent.setup();
const user = userEvent.setup({ pointerEventsCheck: 0 });
render(
<InviteMembers
@@ -40,12 +36,13 @@ describe('InviteMembers - Edge Cases', () => {
/>,
);
await enterInviteEmail(user, 0, VALID_EMAIL);
await enterInviteEmail(user, 1, 'bob@signoz.io');
const emailInputs = screen.getAllByPlaceholderText('e.g. john@signoz.io');
await user.type(emailInputs[0], VALID_EMAIL);
await user.type(emailInputs[1], 'bob@signoz.io');
await user.click(screen.getByTestId('reset-btn'));
const resetInputs = screen.getAllByTestId(/^invite-email-.*-field$/);
const resetInputs = screen.getAllByPlaceholderText('e.g. john@signoz.io');
expect(resetInputs).toHaveLength(2);
resetInputs.forEach((input) => {
expect(input).toHaveValue('');
@@ -53,7 +50,7 @@ describe('InviteMembers - Edge Cases', () => {
});
it('clears results on reset', async () => {
const user = userEvent.setup();
const user = userEvent.setup({ pointerEventsCheck: 0 });
render(
<InviteMembers
@@ -70,7 +67,8 @@ describe('InviteMembers - Edge Cases', () => {
/>,
);
await enterInviteEmail(user, 0, VALID_EMAIL);
const emailInputs = screen.getAllByPlaceholderText('e.g. john@signoz.io');
await user.type(emailInputs[0], VALID_EMAIL);
await pickRole(user, 0, 'role-viewer');
await user.click(screen.getByTestId('submit-btn'));
@@ -86,7 +84,7 @@ describe('InviteMembers - Edge Cases', () => {
describe('results cleared on edit', () => {
it('clears API error when email is edited', async () => {
const user = userEvent.setup();
const user = userEvent.setup({ pointerEventsCheck: 0 });
server.use(createErrorHandler('already_exists', 'User already exists'));
@@ -100,7 +98,8 @@ describe('InviteMembers - Edge Cases', () => {
/>,
);
await enterInviteEmail(user, 0, VALID_EMAIL);
const emailInputs = screen.getAllByPlaceholderText('e.g. john@signoz.io');
await user.type(emailInputs[0], VALID_EMAIL);
await pickRole(user, 0, 'role-viewer');
await user.click(screen.getByTestId('submit-btn'));
@@ -108,7 +107,7 @@ describe('InviteMembers - Edge Cases', () => {
screen.findByTestId('invite-api-error'),
).resolves.toBeInTheDocument();
await user.type(screen.getAllByTestId(/^invite-email-.*-field$/)[0], 'x');
await user.type(emailInputs[0], 'x');
await waitFor(() => {
expect(screen.queryByTestId('invite-api-error')).not.toBeInTheDocument();
@@ -116,7 +115,7 @@ describe('InviteMembers - Edge Cases', () => {
});
it('clears API error when role is changed', async () => {
const user = userEvent.setup();
const user = userEvent.setup({ pointerEventsCheck: 0 });
server.use(createErrorHandler('already_exists', 'User already exists'));
@@ -130,7 +129,8 @@ describe('InviteMembers - Edge Cases', () => {
/>,
);
await enterInviteEmail(user, 0, VALID_EMAIL);
const emailInputs = screen.getAllByPlaceholderText('e.g. john@signoz.io');
await user.type(emailInputs[0], VALID_EMAIL);
await pickRole(user, 0, 'role-viewer');
await user.click(screen.getByTestId('submit-btn'));
@@ -148,8 +148,8 @@ describe('InviteMembers - Edge Cases', () => {
describe('empty submission', () => {
it('does not submit when no rows are touched', async () => {
const user = userEvent.setup();
const onSuccess = jest.fn() as jest.MockedFunction<InviteCallback>;
const user = userEvent.setup({ pointerEventsCheck: 0 });
const onSuccess = jest.fn();
render(
<InviteMembers
@@ -170,7 +170,7 @@ describe('InviteMembers - Edge Cases', () => {
describe('submitting state', () => {
it('disables submit while submitting', async () => {
const user = userEvent.setup();
const user = userEvent.setup({ pointerEventsCheck: 0 });
render(
<InviteMembers
@@ -182,7 +182,8 @@ describe('InviteMembers - Edge Cases', () => {
/>,
);
await enterInviteEmail(user, 0, VALID_EMAIL);
const emailInputs = screen.getAllByPlaceholderText('e.g. john@signoz.io');
await user.type(emailInputs[0], VALID_EMAIL);
await pickRole(user, 0, 'role-viewer');
const submitBtn = screen.getByTestId('submit-btn');
@@ -196,7 +197,7 @@ describe('InviteMembers - Edge Cases', () => {
describe('whitespace handling', () => {
it('trims email whitespace before submission', async () => {
const user = userEvent.setup();
const user = userEvent.setup({ pointerEventsCheck: 0 });
const calls: { email: string }[] = [];
server.use(
@@ -217,7 +218,8 @@ describe('InviteMembers - Edge Cases', () => {
/>,
);
await enterInviteEmail(user, 0, ' alice@signoz.io ');
const emailInputs = screen.getAllByPlaceholderText('e.g. john@signoz.io');
await user.type(emailInputs[0], ' alice@signoz.io ');
await pickRole(user, 0, 'role-viewer');
await user.click(screen.getByTestId('submit-btn'));

View File

@@ -2,7 +2,6 @@ import { rest, server } from 'mocks-server/server';
import { render, screen, userEvent, waitFor } from 'tests/test-utils';
import InviteMembers from '../InviteMembers';
import { InviteMembersProps } from '../types';
import { pickRole } from './roleSelectUtils';
import {
@@ -11,12 +10,9 @@ import {
createRolesHandler,
createSuccessHandler,
createTrackingHandler,
enterInviteEmail,
VALID_EMAIL,
} from './testUtils';
type InviteCallback = Required<InviteMembersProps>['onSuccess'];
describe('InviteMembers - Submission', () => {
beforeEach(() => {
server.use(createRolesHandler(), createSuccessHandler());
@@ -28,7 +24,7 @@ describe('InviteMembers - Submission', () => {
describe('API calls', () => {
it('calls createUser API for each touched row', async () => {
const user = userEvent.setup();
const user = userEvent.setup({ pointerEventsCheck: 0 });
const { handler, calls } = createTrackingHandler();
server.use(handler);
@@ -43,7 +39,8 @@ describe('InviteMembers - Submission', () => {
/>,
);
await enterInviteEmail(user, 0, 'alice@signoz.io');
const emailInputs = screen.getAllByPlaceholderText('e.g. john@signoz.io');
await user.type(emailInputs[0], 'alice@signoz.io');
await pickRole(user, 0, 'role-viewer');
await user.click(screen.getByTestId('submit-btn'));
@@ -58,7 +55,7 @@ describe('InviteMembers - Submission', () => {
});
it('calls createUser API for multiple touched rows', async () => {
const user = userEvent.setup();
const user = userEvent.setup({ pointerEventsCheck: 0 });
const { handler, calls } = createTrackingHandler();
server.use(handler);
@@ -73,11 +70,15 @@ describe('InviteMembers - Submission', () => {
/>,
);
await enterInviteEmail(user, 0, 'alice@signoz.io');
const emailInputs = screen.getAllByPlaceholderText('e.g. john@signoz.io');
await user.type(emailInputs[0], 'alice@signoz.io');
await pickRole(user, 0, 'role-viewer');
await enterInviteEmail(user, 1, 'bob@signoz.io');
await user.type(emailInputs[1], 'bob@signoz.io');
await pickRole(user, 1, 'role-editor');
await enterInviteEmail(user, 2, 'charlie@signoz.io');
await user.type(emailInputs[2], 'charlie@signoz.io');
await pickRole(user, 2, 'role-admin');
await user.click(screen.getByTestId('submit-btn'));
@@ -103,8 +104,8 @@ describe('InviteMembers - Submission', () => {
describe('callbacks', () => {
it('calls onSuccess when all invites succeed', async () => {
const user = userEvent.setup();
const onSuccess = jest.fn() as jest.MockedFunction<InviteCallback>;
const user = userEvent.setup({ pointerEventsCheck: 0 });
const onSuccess = jest.fn();
render(
<InviteMembers
@@ -117,7 +118,8 @@ describe('InviteMembers - Submission', () => {
/>,
);
await enterInviteEmail(user, 0, VALID_EMAIL);
const emailInputs = screen.getAllByPlaceholderText('e.g. john@signoz.io');
await user.type(emailInputs[0], VALID_EMAIL);
await pickRole(user, 0, 'role-viewer');
await user.click(screen.getByTestId('submit-btn'));
@@ -128,8 +130,8 @@ describe('InviteMembers - Submission', () => {
});
it('calls onAllFailed when all invites fail', async () => {
const user = userEvent.setup();
const onAllFailed = jest.fn() as jest.MockedFunction<InviteCallback>;
const user = userEvent.setup({ pointerEventsCheck: 0 });
const onAllFailed = jest.fn();
server.use(createErrorHandler('already_exists', 'User already exists'));
@@ -144,7 +146,8 @@ describe('InviteMembers - Submission', () => {
/>,
);
await enterInviteEmail(user, 0, VALID_EMAIL);
const emailInputs = screen.getAllByPlaceholderText('e.g. john@signoz.io');
await user.type(emailInputs[0], VALID_EMAIL);
await pickRole(user, 0, 'role-viewer');
await user.click(screen.getByTestId('submit-btn'));
@@ -163,10 +166,10 @@ describe('InviteMembers - Submission', () => {
});
it('calls onPartialSuccess when some invites succeed and some fail', async () => {
const user = userEvent.setup();
const onPartialSuccess = jest.fn() as jest.MockedFunction<InviteCallback>;
const onSuccess = jest.fn() as jest.MockedFunction<InviteCallback>;
const onAllFailed = jest.fn() as jest.MockedFunction<InviteCallback>;
const user = userEvent.setup({ pointerEventsCheck: 0 });
const onPartialSuccess = jest.fn();
const onSuccess = jest.fn();
const onAllFailed = jest.fn();
const apiCalls: string[] = [];
let callCount = 0;
@@ -205,9 +208,12 @@ describe('InviteMembers - Submission', () => {
/>,
);
await enterInviteEmail(user, 0, 'alice@signoz.io');
const emailInputs = screen.getAllByPlaceholderText('e.g. john@signoz.io');
await user.type(emailInputs[0], 'alice@signoz.io');
await pickRole(user, 0, 'role-viewer');
await enterInviteEmail(user, 1, 'bob@signoz.io');
await user.type(emailInputs[1], 'bob@signoz.io');
await pickRole(user, 1, 'role-editor');
await user.click(screen.getByTestId('submit-btn'));
@@ -246,7 +252,7 @@ describe('InviteMembers - Submission', () => {
describe('result display', () => {
it('shows success callout when all invites succeed', async () => {
const user = userEvent.setup();
const user = userEvent.setup({ pointerEventsCheck: 0 });
render(
<InviteMembers
@@ -258,7 +264,8 @@ describe('InviteMembers - Submission', () => {
/>,
);
await enterInviteEmail(user, 0, VALID_EMAIL);
const emailInputs = screen.getAllByPlaceholderText('e.g. john@signoz.io');
await user.type(emailInputs[0], VALID_EMAIL);
await pickRole(user, 0, 'role-viewer');
await user.click(screen.getByTestId('submit-btn'));
@@ -269,7 +276,7 @@ describe('InviteMembers - Submission', () => {
});
it('shows error callout with failed emails when API fails', async () => {
const user = userEvent.setup();
const user = userEvent.setup({ pointerEventsCheck: 0 });
server.use(createErrorHandler('already_exists', 'User already exists'));
@@ -283,7 +290,8 @@ describe('InviteMembers - Submission', () => {
/>,
);
await enterInviteEmail(user, 0, VALID_EMAIL);
const emailInputs = screen.getAllByPlaceholderText('e.g. john@signoz.io');
await user.type(emailInputs[0], VALID_EMAIL);
await pickRole(user, 0, 'role-viewer');
await user.click(screen.getByTestId('submit-btn'));
@@ -297,7 +305,7 @@ describe('InviteMembers - Submission', () => {
describe('footer props', () => {
it('provides correct canSubmit state', async () => {
const user = userEvent.setup();
const user = userEvent.setup({ pointerEventsCheck: 0 });
render(
<InviteMembers
@@ -311,13 +319,14 @@ describe('InviteMembers - Submission', () => {
expect(screen.getByTestId('submit-btn')).toBeDisabled();
await enterInviteEmail(user, 0, VALID_EMAIL);
const emailInputs = screen.getAllByPlaceholderText('e.g. john@signoz.io');
await user.type(emailInputs[0], VALID_EMAIL);
expect(screen.getByTestId('submit-btn')).not.toBeDisabled();
});
it('provides touchedCount', async () => {
const user = userEvent.setup();
const user = userEvent.setup({ pointerEventsCheck: 0 });
render(
<InviteMembers
@@ -330,11 +339,12 @@ describe('InviteMembers - Submission', () => {
expect(screen.getByTestId('touched-count')).toHaveTextContent('0');
await enterInviteEmail(user, 0, 'a@b.com');
const emailInputs = screen.getAllByPlaceholderText('e.g. john@signoz.io');
await user.type(emailInputs[0], 'a@b.com');
expect(screen.getByTestId('touched-count')).toHaveTextContent('1');
await enterInviteEmail(user, 1, 'c@d.com');
await user.type(emailInputs[1], 'c@d.com');
expect(screen.getByTestId('touched-count')).toHaveTextContent('2');
});

View File

@@ -4,7 +4,7 @@ const ROLE_TRIGGER_TEST_ID = /^invite-role-[0-9a-f-]{36}$/;
type User = ReturnType<typeof userEvent.setup>;
function getRoleTrigger(rowIndex: number): HTMLElement {
export function getRoleTrigger(rowIndex: number): HTMLElement {
return screen.getAllByTestId(ROLE_TRIGGER_TEST_ID)[rowIndex];
}

View File

@@ -1,13 +1,10 @@
import { RestHandler } from 'msw';
import { rest } from 'mocks-server/server';
import { screen, userEvent } from 'tests/test-utils';
type User = ReturnType<typeof userEvent.setup>;
export const CREATE_USER_ENDPOINT = '*/api/v2/users';
const LIST_ROLES_ENDPOINT = '*/api/v1/roles';
export const LIST_ROLES_ENDPOINT = '*/api/v1/roles';
const MOCK_ROLES = [
export const MOCK_ROLES = [
{ id: 'role-admin', name: 'Admin', description: 'Admin role' },
{ id: 'role-editor', name: 'Editor', description: 'Editor role' },
{ id: 'role-viewer', name: 'Viewer', description: 'Viewer role' },
@@ -55,12 +52,3 @@ export function createTrackingHandler(): {
});
return { handler, calls };
}
export async function enterInviteEmail(
user: User,
rowIndex: number,
email: string,
): Promise<void> {
await user.click(screen.getAllByTestId(/^invite-email-.*-field$/)[rowIndex]);
await user.paste(email);
}

View File

@@ -12,7 +12,7 @@ export interface InviteResult {
error?: string;
}
interface FooterRenderProps {
export interface FooterRenderProps {
submit: () => Promise<InviteResult[]>;
reset: () => void;
canSubmit: boolean;

View File

@@ -12,7 +12,7 @@ import { useAppContext } from 'providers/App/App';
import './LaunchChatSupport.styles.scss';
interface LaunchChatSupportProps {
export interface LaunchChatSupportProps {
eventName: string;
attributes: Record<string, unknown>;
message?: string;

View File

@@ -0,0 +1,14 @@
export const onboardingHelpMessage = (
dataSourceName: string,
moduleId: string,
): string => `Hi Team,
I am facing issues sending data to SigNoz. Here are my application details
Data Source: ${dataSourceName}
Framework:
Environment:
Module: ${moduleId}
Thanks
`;

View File

@@ -24,6 +24,11 @@
flex-wrap: wrap;
}
.filtersLabel {
color: var(--l2-foreground);
margin-right: 2px;
}
.filterControls {
display: flex;
align-items: center;

View File

@@ -31,7 +31,7 @@ interface Props {
placeholder?: string;
// Rendered at the end of the search row (e.g. the New Dashboard action).
rightSlot?: ReactNode;
// Rendered in the filters row before the chips. A function receives the draft.
// Rendered in the filters row after the chips. A function receives the draft.
extraFilters?: ReactNode | ((api: ExtraFiltersApi) => ReactNode);
// Shows Clear even when the query is empty.
hasExtraFilters?: boolean;
@@ -142,9 +142,6 @@ function FilterZone({
className={styles.filterControls}
data-testid={`${testIdPrefix}-filter-zone`}
>
{typeof extraFilters === 'function'
? extraFilters({ draft, applyDraft, setDraft })
: extraFilters}
<FilterChips
{...createdByProps}
updated={reflected.updated}
@@ -153,6 +150,9 @@ function FilterZone({
onApply={run}
disabled={disabled}
/>
{typeof extraFilters === 'function'
? extraFilters({ draft, applyDraft, setDraft })
: extraFilters}
{(!isEmpty || hasExtraFilters) && (
<Button
disabledTooltip={undefined}

View File

@@ -43,7 +43,6 @@ function MultiSelectFilter({
allowClear
className={cx(styles.select, styles.selectWide)}
placeholder={placeholder}
aria-label={placeholder}
value={value}
options={options}
optionFilterProp="label"
@@ -53,10 +52,7 @@ function MultiSelectFilter({
disabled={disabled}
onClear={onClear}
optionRender={(option): JSX.Element => (
<div
className={styles.checkOption}
data-testid={`${testId}-option-${String(option.value)}`}
>
<div className={styles.checkOption}>
<div className={styles.checkOptionBox}>
<Checkbox
color="primary"

View File

@@ -1,10 +1,4 @@
import {
type FocusEvent,
type MouseEvent,
useCallback,
useMemo,
useRef,
} from 'react';
import { type MouseEvent, useCallback, useMemo, useRef } from 'react';
import {
autocompletion,
closeCompletion,
@@ -33,7 +27,7 @@ import styles from './SearchBar.module.scss';
interface Props {
value: string;
grammar: DslGrammar;
// Ids: `${testIdPrefix}`, `-field` (the editable area), `-submit`, `-dirty`.
// Ids: `${testIdPrefix}`, `-submit`, `-dirty`.
testIdPrefix: string;
onChange: (value: string) => void;
onSubmit: () => void;
@@ -73,25 +67,10 @@ function SearchBar({
const onSubmitRef = useRef(handleSubmit);
onSubmitRef.current = handleSubmit;
// Leaving the box runs an unrun draft, e.g. terms picked from the suggestions.
// A blur from switching windows or tabs does not.
const handleBlur = useCallback(
(event: FocusEvent<HTMLDivElement>): void => {
const stillInside = event.currentTarget.contains(
event.relatedTarget as Node | null,
);
if (!stillInside && dirty && !disabled && document.hasFocus()) {
handleSubmit();
}
},
[dirty, disabled, handleSubmit],
);
const extensions = useMemo(
() => [
dslHighlight,
editorTheme,
EditorView.contentAttributes.of({ 'data-testid': `${testIdPrefix}-field` }),
// Wrap a long query onto the next line instead of scrolling horizontally.
EditorView.lineWrapping,
// Read-only is not enough: these open the list on click and accepting an
@@ -143,15 +122,12 @@ function SearchBar({
]),
),
],
[disabled, testIdPrefix],
[disabled],
);
return (
<div className={styles.wrapper}>
<div
className={cx(styles.field, { [styles.disabled]: disabled })}
onBlur={handleBlur}
>
<div className={cx(styles.field, { [styles.disabled]: disabled })}>
<Search
size={12}
color={Color.BG_VANILLA_400}

View File

@@ -1,101 +0,0 @@
import type { ComponentProps } from 'react';
import { render, screen, userEvent } from 'tests/test-utils';
import type { DslGrammar } from '../../dsl/types';
import SearchBar from '../SearchBar';
type SearchBarProps = ComponentProps<typeof SearchBar>;
const GRAMMAR: DslGrammar = {
fields: [{ key: 'name', type: 'string' }],
dynamicKey: { detail: 'tag', prefix: '' },
};
function renderSearchBar(props: { dirty: boolean; disabled?: boolean }): {
onSubmit: jest.MockedFunction<SearchBarProps['onSubmit']>;
onSubmitted: jest.MockedFunction<NonNullable<SearchBarProps['onSubmitted']>>;
} {
const onSubmit = jest.fn() as jest.MockedFunction<SearchBarProps['onSubmit']>;
const onSubmitted = jest.fn() as jest.MockedFunction<
NonNullable<SearchBarProps['onSubmitted']>
>;
render(
<>
<SearchBar
value="name = 'x'"
grammar={GRAMMAR}
testIdPrefix="list-search"
onChange={jest.fn()}
onSubmit={onSubmit}
onSubmitted={onSubmitted}
dirty={props.dirty}
disabled={props.disabled}
/>
<button type="button" data-testid="outside">
outside
</button>
</>,
);
return { onSubmit, onSubmitted };
}
function searchContent(): HTMLElement {
return screen
.getByTestId('list-search')
.querySelector('.cm-content') as HTMLElement;
}
describe('SearchBar — run on blur', () => {
let hasFocus: jest.SpyInstance<boolean, []>;
beforeEach(() => {
// jsdom reports no focus once it leaves the editor; a focused browser window does.
hasFocus = jest.spyOn(document, 'hasFocus').mockReturnValue(true);
});
afterEach(() => {
jest.restoreAllMocks();
});
it('runs an unrun draft when focus leaves the box', async () => {
const user = userEvent.setup({ pointerEventsCheck: 0 });
const { onSubmit, onSubmitted } = renderSearchBar({ dirty: true });
await user.click(searchContent());
await user.click(screen.getByTestId('outside'));
expect(onSubmit).toHaveBeenCalledTimes(1);
expect(onSubmitted).toHaveBeenCalledWith(true);
});
it('does nothing when the draft was already run', async () => {
const user = userEvent.setup({ pointerEventsCheck: 0 });
const { onSubmit } = renderSearchBar({ dirty: false });
await user.click(searchContent());
await user.click(screen.getByTestId('outside'));
expect(onSubmit).not.toHaveBeenCalled();
});
it('does nothing when focus leaves the window', async () => {
const user = userEvent.setup({ pointerEventsCheck: 0 });
const { onSubmit } = renderSearchBar({ dirty: true });
await user.click(searchContent());
hasFocus.mockReturnValue(false);
await user.click(screen.getByTestId('outside'));
expect(onSubmit).not.toHaveBeenCalled();
});
it('runs once when Run query is clicked with an unrun draft', async () => {
const user = userEvent.setup({ pointerEventsCheck: 0 });
const { onSubmit } = renderSearchBar({ dirty: true });
await user.click(searchContent());
await user.click(screen.getByTestId('list-search-submit'));
expect(onSubmit).toHaveBeenCalledTimes(1);
});
});

Some files were not shown because too many files have changed in this diff Show More