Skip to main content

Interface: NestLensConfig

Defined in: nestlens.config.ts:619

Properties​

alerting?​

optional alerting: AlertingConfig

Defined in: nestlens.config.ts:707

Proactive alerting — POST collected entries (exceptions by default) to Slack/Discord/generic webhooks. Disabled by default.


authorization?​

optional authorization: AuthorizationConfig

Defined in: nestlens.config.ts:679


enabled?​

optional enabled: boolean

Defined in: nestlens.config.ts:621


filter()?​

optional filter: (entry) => boolean | Promise<boolean>

Defined in: nestlens.config.ts:715

Filter function to determine if an entry should be collected. Return true to collect the entry, false to skip it. Errors are logged but don't block collection (fail-open).

Parameters​

entry​

Entry

Returns​

boolean | Promise<boolean>


filterBatch()?​

optional filterBatch: (entries) => Entry[] | Promise<Entry[]>

Defined in: nestlens.config.ts:722

Batch filter function to process multiple entries at once. Return the entries that should be collected. Errors are logged but don't block collection (fail-open).

Parameters​

entries​

Entry[]

Returns​

Entry[] | Promise<Entry[]>


path?​

optional path: string

Defined in: nestlens.config.ts:622


preset?​

optional preset: "failures-only"

Defined in: nestlens.config.ts:646

A configuration for a job people keep writing out themselves.

'failures-only' is the production stance: record nothing ordinary, keep the failures whole, and stop paying for payload capture nothing will keep. It sets sampling.rate: 0 with the failing types in sampling.always, a filter that narrows those types to their failures, and turns off GraphQL response capture and resolver tracing.

Everything the application writes wins over it, except filter, which composes: under a preset, a filter of your own means "the failures, and this too".

NestLensModule.forRoot({
preset: 'failures-only',
server: { host: '0.0.0.0', port: 3001 },
storage: { driver: 'redis', redis: { url: process.env.REDIS_URL, db: 1 } },
alerting: { webhooks: [{ url: process.env.ALERT_WEBHOOK, type: 'slack' }] },
})

pruning?​

optional pruning: PruningConfig

Defined in: nestlens.config.ts:685


rateLimit?​

optional rateLimit: false | RateLimitConfig

Defined in: nestlens.config.ts:694

Rate limiting configuration for API endpoints. Set to false to disable rate limiting (default). Set to an object to enable: { windowMs: 60000, maxRequests: 100 }. Default: disabled (NestLens is a development/debugging tool)


sampling?​

optional sampling: SamplingConfig

Defined in: nestlens.config.ts:667

Record a fraction of traffic instead of all of it.

Absent by default, which records everything. See SamplingConfig.


security?​

optional security: SecurityConfig

Defined in: nestlens.config.ts:700

Security configuration for data masking and input validation.


server?​

optional server: DashboardServerConfig

Defined in: nestlens.config.ts:676

Serve the dashboard on a listener of its own, bound to a chosen address, instead of mounting it on the application's server.

Absent by default, which is the mounted behaviour every installation has today. See DashboardServerConfig.


storage?​

optional storage: StorageConfig

Defined in: nestlens.config.ts:682


trustProxy?​

optional trustProxy: boolean

Defined in: nestlens.config.ts:660

Trust the X-Forwarded-Prefix header when building the dashboard's asset and API URLs. Enable this only when NestLens sits behind a reverse proxy that strips a path segment (nginx proxy_pass with a trailing slash, a Kubernetes ingress rewrite) and that proxy sets the header itself.

Off by default: the header is attacker-controlled, and honouring it unconditionally would let a request repoint the dashboard's URLs — which a shared cache in front of the application could then serve to other users.

Default​

false

watchers?​

optional watchers: object

Defined in: nestlens.config.ts:725

batch?​

optional batch: boolean | BatchWatcherConfig

cache?​

optional cache: boolean | CacheWatcherConfig

command?​

optional command: boolean | CommandWatcherConfig

dump?​

optional dump: boolean | DumpWatcherConfig

event?​

optional event: boolean | EventWatcherConfig

exception?​

optional exception: boolean | ExceptionWatcherConfig

gate?​

optional gate: boolean | GateWatcherConfig

graphql?​

optional graphql: boolean | GraphQLWatcherConfig

httpClient?​

optional httpClient: boolean | HttpClientWatcherConfig

job?​

optional job: boolean | JobWatcherConfig

log?​

optional log: boolean | LogWatcherConfig

mail?​

optional mail: boolean | MailWatcherConfig

model?​

optional model: boolean | ModelWatcherConfig

notification?​

optional notification: boolean | NotificationWatcherConfig

query?​

optional query: boolean | QueryWatcherConfig

redis?​

optional redis: boolean | RedisWatcherConfig

request?​

optional request: boolean | RequestWatcherConfig

schedule?​

optional schedule: boolean | ScheduleWatcherConfig

view?​

optional view: boolean | ViewWatcherConfig