@tunnlo/filters
v0.1.1
Published
Filter and throttle engine for Tunnlo pipelines
Maintainers
Readme
@tunnlo/filters
Filter and throttle engine for Tunnlo pipelines.
Part of the Tunnlo project -- a real-time data-to-agent bridge with intelligent filtering.
Installation
npm install @tunnlo/filtersUsage
import { RateLimiterFilter, ContentFilter, DedupFilter } from '@tunnlo/filters';
// Allow at most 30 events per minute
const rateLimiter = new RateLimiterFilter({ max_events_per_minute: 30 });
// Only pass events matching specific patterns
const contentFilter = new ContentFilter({
rules: [{ field: 'payload.level', pattern: 'error|warn', action: 'include' }],
});
// Deduplicate events within a 10-second window
const dedup = new DedupFilter({
window_seconds: 10,
key_fields: ['payload.message'],
});API
RateLimiterFilter-- limits event throughput to a configurable rateContentFilter-- includes or excludes events based on field-matching rulesDedupFilter-- drops duplicate events within a sliding time windowWindowedAggregationFilter-- buffers events and emits aggregated summaries per time windowAdaptiveSamplingFilter-- dynamically adjusts sampling rate based on event volumePriorityRouterFilter-- routes events to different processing paths by priority level
License
MIT
