Repository navigation
feat(server): export gateway OCSF events as OTLP log records - #4500
Merged
Merged
Conversation
|
🌿 Preview your docs: https://nvidia-preview-pr-4500.docs.buildwithfern.com/openshell |
krishicks
force-pushed
the
feat/4499-gateway-ocsf-otlp-logs/krishicks
branch
4 times, most recently
from
October 13, 2026 23:36
281fda6 to
b087caa
Compare
8 of 9 tasks
krishicks
added this pull request to stack #4546
October 14, 2026 14:15
krishicks
force-pushed
the
feat/4499-gateway-ocsf-otlp-logs/krishicks
branch
from
October 14, 2026 17:02
b087caa to
1d973d9
Compare
TaylorMutch
reviewed
Oct 14, 2026
krishicks
force-pushed
the
feat/4499-gateway-ocsf-otlp-logs/krishicks
branch
from
October 14, 2026 17:49
1d973d9 to
582bcd8
Compare
TaylorMutch
reviewed
Oct 14, 2026
The gateway only persisted its OCSF events to the JSONL file, so collectors had to tail that file. Adding `[openshell.gateway.otlp.ocsf]` now also exports each gateway OCSF event as an OTLP log record, using the same resource identity as gateway traces. `schema_version` optionally downgrades the exported JSON to OCSF 1.1 or 1.3. OTLP endpoints are now configured per signal, so OCSF events can go to a collector that feeds a SIEM while spans go elsewhere. The existing `[openshell.gateway.otlp]` `endpoint` is the default for every signal and on its own still enables trace export. `[otlp.traces]` overrides the trace endpoint, and `[otlp.ocsf]` takes its own `endpoint` or falls back to the default. Each record carries the OCSF JSON as its body, the event time as its timestamp, a severity mapped from `severity_id`, and `ocsf.*` and `openshell.sandbox.id` attributes for filtering without parsing the body. Records flow through a queue bounded by count and bytes to the SDK OTLP log exporter in batches bounded the same way. Failed exports retry with backoff; records lost to a full queue, an oversized body, or exhausted retries are counted in metrics and reported to the collector in an `openshell.ocsf.gap` record on the next successful export. The exporter lives in `openshell-otel` so other processes can share it. Helm deployments set the `traces` and `ocsf` tables through `gatewayConfig`, and the local development gateway tasks enable OCSF export. Closes #4499 Refs #2892 Signed-off-by: Kris Hicks <khicks@nvidia.com>
7 tasks
krishicks
force-pushed
the
feat/4499-gateway-ocsf-otlp-logs/krishicks
branch
from
October 14, 2026 18:36
582bcd8 to
9b890ef
Compare
TaylorMutch
approved these changes
Oct 14, 2026
This was referenced Oct 14, 2026
6 of 7 tasks
8 of 9 tasks
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Export the gateway's OCSF events as OTLP log records when
[openshell.gateway.otlp.ocsf]setsenabled = true, so they reach a collector instead of only the local JSONL file. OTLP endpoints become configurable per signal, so OCSF events can go to a collector that feeds a SIEM while spans go elsewhere. This is the first part of #2892: gateway-produced events only. Supervisor events follow in later PRs.Related Issue
Closes #4499
Refs #2892
Refs #3224 (close manually once #4500 and #4545 have both landed)
Changes
Per-signal OTLP config:
endpointbehave as before.enabled = true, which defaults tofalselike[mtls_auth] enabled. Enabling traces never sends OCSF events, and an[otlp.ocsf]table without the flag exports nothing.enabled = trueandendpointin[otlp.ocsf]alone.[otlp.metrics]is rejected until OTLP metric export exists, and so is any enabled signal without an endpoint.OTLP log export (
openshell-otel/src/ocsf.rs):severity_id, andocsf.*andopenshell.sandbox.idattributes.schema_versionoptionally downgrades the exported JSON to OCSF 1.1 or 1.3.Delivery:
reason="oversized").reasonand reported to the collector in anopenshell.ocsf.gaprecord on the next successful export.Shared OTLP setup (
openshell-otel):OtlpTarget, so the trace provider and the log exporter share one resource identity and the same transport. Anhttps://endpoint uses TLS with the platform trust roots for both.OcsfOtlp) lives inopenshell-otelso other processes can share it.OcsfSchemaVersionmoves intoopenshell-ocsf.OtlpTraceConfigis renamedOtlpExportConfig.OtlpExportowns an optional trace provider and an optional OCSF exporter, each with its own endpoint, and shuts both down.Configuration and deployment:
tracesandocsftables throughgatewayConfig. Chart tests cover rendering them, includingopenshell.gateway.otlp.ocsf: {enabled: true}with the shared endpoint.gateway:*tasks enable OCSF export when a collector is listening on127.0.0.1:4317.Docs:
openshell_ocsf_otlp_{queued,exported,dropped,export_errors,retries}_total.debug-openshell-cluster.Testing
cargo fmt --checkandcargo clippy --workspace --all-targets -D warningscargo nextest run -p openshell-ocsf -p openshell-otel -p openshell-otel-test-support -p openshell-server -p openshell-gateway(including the TLS and gzip integration tests): 2,390 passedcargo nextest run -p openshell-otel --libon its own: 36 passedcargo nextest run -p openshell-server -p openshell-otel -p openshell-gatewayafter theenabledflag and rebase on main: 2,296 passedhelm unittest deploy/helm/openshell: 336 passedopenshell_ocsf_otlp_exported_totalmatchedqueued_total).Checklist