Feat/phase4 fe consumer - #17
Conversation
… package references
…dditional FeatureEngineering settings
…er implementations
…handling and additional health metrics
…d PollingIntervalMs in FeatureEngineeringOptions
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThe feature-engineering service now supports local JSONL telemetry ingestion and an Event Hub consumer stub. It adds configuration, persisted offsets, health updates, container directories, Azure dependencies, and integration tests. ChangesTelemetry consumer integration
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Program
participant LocalJsonlTailConsumer
participant TelemetryFile
participant WindowStore
participant HealthState
Program->>LocalJsonlTailConsumer: Start selected hosted consumer
LocalJsonlTailConsumer->>TelemetryFile: Poll and read appended JSONL
TelemetryFile-->>LocalJsonlTailConsumer: Return telemetry records
LocalJsonlTailConsumer->>WindowStore: Add valid events
LocalJsonlTailConsumer->>HealthState: Update reachability and metrics
LocalJsonlTailConsumer->>TelemetryFile: Persist offset
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/api/feature-engineering/appsettings.json`:
- Line 19: Align the Blob Storage configuration names so options binding
populates the value: update src/api/feature-engineering/appsettings.json:19-19
and Models/EventHubOptions.cs:10-10 to use the same case-insensitive
key/property name, preserving the existing BlobStorageUrl usage.
In `@src/api/feature-engineering/Consumers/LocalJsonlTailConsumer.cs`:
- Around line 90-121: Replace the StreamReader-based processing in the consumer
method with a byte-tracking reader that records each fully consumed line’s byte
offset, and use that tracked offset when updating _offset instead of
fs.Position. Preserve the existing event processing and periodic checkpoint
behavior, and move the final offset update and FlushOffset into a finally block
so the latest confirmed offset is persisted even when ReadLineAsync is
cancelled.
In `@src/api/feature-engineering/Dockerfile`:
- Around line 13-16: Update the runtime stage after the directory-creation RUN
instruction to set USER app before ENV ASPNETCORE_URLS and the ENTRYPOINT,
ensuring the application runs as the image’s non-root app user. Preserve the
existing runtime configuration and verify deployment security settings do not
override this user with a privileged identity.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 48c36a0a-2b04-4995-9cdf-4d5a92b2cb6d
📒 Files selected for processing (13)
experiments/results/telemetry_2026-08-04.jsonlsrc/api/feature-engineering/AFIE.FeatureEngineering.csprojsrc/api/feature-engineering/Consumers/EventHubConsumer.cssrc/api/feature-engineering/Consumers/IMetricEventConsumer.cssrc/api/feature-engineering/Consumers/LocalJsonlTailConsumer.cssrc/api/feature-engineering/Dockerfilesrc/api/feature-engineering/Health/FeatureEngineeringHealthCheck.cssrc/api/feature-engineering/Models/EventHubOptions.cssrc/api/feature-engineering/Models/FeatureEngineeringOptions.cssrc/api/feature-engineering/Program.cssrc/api/feature-engineering/appsettings.jsonsrc/api/feature-engineering/experiments/state/fe_consumer_offset.jsontests/AFIE.FeatureEngineering.Tests/Consumers/LocalJsonlTailConsumerTests.cs
Summary
IMetricEventConsumerstrategy with two implementations:LocalJsonlTailConsumer(active in dev) andEventHubConsumer(Phase-8 stub, disabled by default).
experiments/state/fe_consumer_offset.json, handles daily UTCrollover, and skips malformed lines instead of crashing.
/healthnow reports real staleness: Degraded if no events yet orlast event older than 45s.
Test plan
dotnet build AFIE.slnxcleandotnet test tests/AFIE.FeatureEngineering.Tests/— 11 passingdotnet test tests/AFIE.Telemetry.Tests/— 20 still passing/healthshows
eventsConsumedTotal=1,workloadsTracked=1,sourceFileReachable=trueConsumerMode=eventhuband confirm the stub warning logsSummary by CodeRabbit