Skip to content

Conversation

@major
Copy link
Contributor

@major major commented Jan 21, 2026

Summary

Add Splunk HEC (HTTP Event Collector) integration for sending inference telemetry events, matching the rlsapi v1 event format.

This PR includes:

  • SplunkConfiguration Pydantic model with validation
  • Async Splunk HEC client using aiohttp
  • Inference event builder matching rlsapi format (extensible via observability.formats subpackage)
  • deployment_environment config field for telemetry

Commits

  1. feat(config): add SplunkConfiguration model and fields

    • New SplunkConfiguration with enabled, url, token_path, index, source, timeout, verify_ssl
    • New deployment_environment field in Configuration
  2. feat(observability): add observability package structure

    • New src/observability/ package with public exports
  3. feat(observability): add async Splunk HEC client

    • read_token_from_file() for secure token loading
    • send_splunk_event() async function using aiohttp
    • Graceful skip when Splunk not configured
    • Warning logs on errors (non-blocking)
  4. feat(observability): add inference event builder for rlsapi v1

    • InferenceEventData dataclass for type-safe event data
    • build_inference_event() in observability.formats.rlsapi module
    • Extensible: create new modules in formats/ for custom event formats

Type of change

  • New feature

Tools used to create PR

  • Assisted-by: Claude

Related Tickets & Documents

Checklist before requesting a review

  • I have performed a self-review of my code.
  • PR has passed all pre-merge test jobs.
  • If it is a core feature, I have added thorough tests.

Testing

22 new tests across 3 test files:

  • tests/unit/models/config/test_splunk_configuration.py (11 tests)

    • Default values, disabled validation skip, required field validation, custom values
  • tests/unit/observability/test_splunk.py (9 tests)

    • Token file reading, missing file handling, skip scenarios, successful send, error handling
  • tests/unit/observability/formats/test_rlsapi.py (2 tests)

    • Full event building, auth-disabled value handling

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 21, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@major major marked this pull request as draft January 21, 2026 15:30
@major major changed the title RSPEED-2326: feat(config): add Splunk HEC configuration schema RSPEED-2326: feat(observability): add Splunk HEC integration Jan 21, 2026
@major major force-pushed the rspeed-2326-splunk-config branch from c23203f to 7a0fd52 Compare January 21, 2026 15:52
@major major force-pushed the rspeed-2326-splunk-config branch from 7a0fd52 to 8c3acd2 Compare January 21, 2026 16:05
major added 4 commits January 21, 2026 10:05
Add SplunkConfiguration Pydantic model for Splunk HEC settings:
- enabled: toggle for Splunk integration
- url: HEC endpoint URL
- token_path: path to HEC auth token file
- index: target Splunk index
- source: event source identifier (default: lightspeed-stack)
- timeout: HTTP timeout in seconds (default: 5)
- verify_ssl: SSL verification toggle (default: True)

Add splunk and deployment_environment fields to Configuration class.

Signed-off-by: Major Hayden <major@redhat.com>
Create new observability package for telemetry and event collection.
Export send_splunk_event and build_inference_event as public API.

Signed-off-by: Major Hayden <major@redhat.com>
Implement send_splunk_event() async function for sending events to Splunk:
- Uses aiohttp for async HTTP requests
- Reads HEC token from file path
- Graceful degradation when config missing/disabled
- Logs warnings on send failures (no exceptions raised)

Add splunk and deployment_environment properties to AppConfig.

Signed-off-by: Major Hayden <major@redhat.com>
…api v1

Implement build_inference_event() matching rlsapi Splunk event format:
- InferenceEventData dataclass for structured input
- Handles auth_disabled case for org_id/system_id
- Maps all fields from request data and configuration
- Empty placeholders for RAG fields (not yet implemented)

Signed-off-by: Major Hayden <major@redhat.com>
@major major marked this pull request as ready for review January 21, 2026 16:39
Copy link
Contributor

@tisnik tisnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, interesting addition

@tisnik tisnik merged commit 5f1ffaa into lightspeed-core:main Jan 23, 2026
17 of 20 checks passed
@major major deleted the rspeed-2326-splunk-config branch January 23, 2026 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants