Skip to content

How It Works

DarkCrow consumes Redfly’s telemetry topic, writes each event to Cassandra with a one-year TTL, and every replica updates its local Solr core from an index topic.

Ingestion

  1. Redfly validates each event and publishes it to persistent://odssbc/redfly/telemetry, keyed by tenant id.
  2. One DarkCrow replica receives it through the Shared subscription darkcrow-store and writes it to Cassandra.
  3. That replica publishes to persistent://odssbc/darkcrow/index.
  4. Every replica consumes the index topic through its own Exclusive subscription, darkcrow-index-<pod>, and updates its local Solr core.

Event schema

Each event carries event_id (UUIDv7), ts, app, app_version, tenant_id, user_hash (HMAC-SHA256 of the Redfly user id with a rotating per-tenant salt), session_hash, name, level, duration_ms and attrs (map<text,text>, at most 32 keys, 256 characters each).

Data layer

Keyspace darkcrow, using NetworkTopologyStrategy {<dc>: 3} and LOCAL_QUORUM. The CQL is written by hand.

TablePrimary keyNotes
events((tenant_id, day), ts, event_id)app, app_version, user_hash, session_hash, name, level, duration_ms, attrs; 1-year TTL, TWCS in 1-day windows
events_by_id(event_id)tenant_id, day and ts, same TTL

No views are required; search goes through Solr.

Search

A single Solr core, telemetry, with these fields:

  • event_id (id), tenant_id (string, filter), app, app_version, name (string facets), level (string facet).
  • ts (pdate), duration_ms (plong), user_hash and session_hash (string).
  • attrs_* (dynamic string fields) and text (copyField of name and attrs values).

Retention: a FairFeather job runs a nightly delete by query ts:[* TO NOW-1YEAR].

Authentication and authorization

  • The Shiro realm RedflyTokenRealm verifies the Redfly PASETO and checks the SeaWave revocation deny-list, fed from odssbc/redfly/revocations.
  • telemetry:read: users with the operator role see every tenant; users with tenant-admin see only their own tenants.

REST interfaces

MethodPathAuthPurpose
GET/v1/searchtelemetry:readFull-text and faceted search: q, tenant, app, name, level, from, to, cursor
GET/v1/telemetry/{id}telemetry:readFetch one event
POST/v1/telemetryservice mTLSInternal ingest and replay only
POST/v1/admin/reindexoperatorRebuild the local Solr core from Cassandra
POST/v1/admin/purgeservice mTLS (FairFeather)Run the retention purge

Ports

PortBindPurpose
8444pod IPHTTPS REST API and health
7000pod IP, TLSCassandra internode traffic
9042127.0.0.1CQL native (app → embedded Cassandra)
2181127.0.0.1SunLink ZooKeeper protocol (Curator)
7480pod IP, mTLSSunLink Raft ring between replicas
6379127.0.0.1SeaWave RESP (Spring Session, deny-list)
7481pod IP, mTLSSeaWave peer replication

Key environment variables

VariablePurpose
DARKCROW_CASSANDRA_DATA_DIR, _KEYSPACE, _DC, _SEEDSEmbedded Cassandra
DARKCROW_SOLR_DATA_DIREmbedded Solr index directory
DARKCROW_SHIRO_CONFIGShiro configuration file path
DARKCROW_SUNLINK_CLUSTERSunLink peers
DARKCROW_PULSAR_SERVICE_URLPulsar broker URL
DARKCROW_REDFLY_KEYS_URLRedfly /v1/auth/keys, for PASETO verification