Skip to content

feat: add Cribl Stream/Edge provider (push + pull, 55 tests)#6169

Closed
chengyixu wants to merge 2 commits intokeephq:mainfrom
chengyixu:feat/cribl-provider
Closed

feat: add Cribl Stream/Edge provider (push + pull, 55 tests)#6169
chengyixu wants to merge 2 commits intokeephq:mainfrom
chengyixu:feat/cribl-provider

Conversation

@chengyixu
Copy link
Copy Markdown

Summary

Adds a new provider for Cribl, the universal observability
pipeline for logs, metrics, traces, and security events.

Closes #4230

Features

  • Push mode — receives events from Cribl's HTTP Destination; handles single objects,
    JSON arrays (batching), and wrapper envelopes (events/results/records/items)
  • Pull mode — queries Cribl REST API for unhealthy workers and failed pipeline jobs
  • Auth: Bearer token or username/password with token caching
  • Full severity mapping: critical/error/warning/info/debug/low
  • Full status mapping: firing/active/failed/resolved/ok/cleared/suppressed
  • Unix timestamps in seconds or milliseconds both supported
  • Name/description fallback chains for arbitrary Cribl event schemas

Files

File Description
keep/providers/cribl_provider/cribl_provider.py Provider
keep/providers/cribl_provider/alerts_mock.py Mock payloads
tests/providers/cribl_provider/test_cribl_provider.py 55 unit tests
docs/providers/documentation/cribl-provider.mdx Documentation
docs/mint.json Sidebar registration

/claim #4230

Adds a new Keep provider for Cribl, a universal observability pipeline for
routing, reducing, and enriching logs, metrics, traces, and security events.

### What's included

**Provider** (`keep/providers/cribl_provider/cribl_provider.py`)
- Push mode: receives events forwarded from Cribl via its HTTP Destination;
  handles single objects, JSON arrays (Cribl batching), and wrapper envelopes
  with events/results/records/items keys
- Pull mode: queries Cribl REST API for unhealthy workers and failed pipeline
  jobs; surfaces each problem as a Keep alert
- Auth: Bearer token (api_key) or username/password with token caching
- `_format_single_event`: normalises arbitrary Cribl event fields into AlertDto
  (name fallback chain, description fallback, severity map, status map,
  Unix timestamps in seconds or milliseconds)
- SEVERITY_MAP: critical/error/warning/warn/info/debug/low
- STATUS_MAP: firing/active/failed/error/resolved/ok/cleared/suppressed

**Mock payloads** (`keep/providers/cribl_provider/alerts_mock.py`)
- Single log event, infrastructure alert, batch array, wrapped events,
  minimal raw event, resolved event

**Tests** (`tests/providers/cribl_provider/test_cribl_provider.py`)
- 55 unit tests covering config, auth headers, login token caching,
  scope validation, _format_single_event (all edge cases), _format_alert
  (all envelope shapes), _get_alerts pull mode, severity/status maps,
  provider metadata

**Docs** (`docs/providers/documentation/cribl-provider.mdx`)
- Setup guide for webhook (HTTP Destination) and pull (REST API) modes,
  supported payload formats table

**Docs index** (`docs/mint.json`)
- Registers cribl-provider in alphabetical position

Closes keephq#4230

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 29, 2026

@chengyixu is attempting to deploy a commit to the KeepHQ Team on Vercel.

A member of the Team first needs to authorize it.

@dosubot dosubot bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Mar 29, 2026
@gitguardian
Copy link
Copy Markdown

gitguardian bot commented Mar 29, 2026

️✅ There are no secrets present in this pull request anymore.

If these secrets were true positive and are still valid, we highly recommend you to revoke them.
While these secrets were previously flagged, we no longer have a reference to the
specific commits where they were detected. Once a secret has been leaked into a git
repository, you should consider it compromised, even if it was deleted immediately.
Find here more information about risks.


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@dosubot dosubot bot added Documentation Improvements or additions to documentation Feature A new feature Provider Providers related issues labels Mar 29, 2026
Replace admin/pass/s3cret test fixtures with clearly-fake placeholder
values (test-user/test-placeholder) to resolve GitGuardian
false-positive secret detection alert on PR keephq#6161. No real credentials
are used in these tests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@chengyixu
Copy link
Copy Markdown
Author

All CI checks are now passing (Validate PR title, Validate PR to Issue link, and GitGuardian Security Checks). The earlier GitGuardian failure was a false positive caused by a test fixture string — fixed in the latest commit (7ad7ac1) by replacing it with a clearly non-credential placeholder.

This PR adds a full Cribl provider with push (webhook) and pull mode, 55 unit tests, and all standard Keep provider capabilities. Happy to address any review feedback!

@shahargl
Copy link
Copy Markdown
Member

shahargl commented Apr 5, 2026

Closing: AI-generated spam.

@shahargl shahargl closed this Apr 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🙋 Bounty claim Documentation Improvements or additions to documentation Feature A new feature Provider Providers related issues size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[🔌 Provider]: Cribl

2 participants