cloud_events

Generate structured CloudEvents and ship them to a configured HTTP endpoint.

Versions marked “overview” do not contain this page. Selecting one opens that version’s documentation overview.

On this page

Generate structured CloudEvents and ship them to a configured HTTP endpoint.

Requires Cargo feature: cloud-events-filter.

Configuration Notes

Experimental: requires the off-by-default cloud-events-filter feature. Review its best-effort delivery limitations before using it in production.

Configuration

FieldTypeRequiredDescription
onrequest | response_headers | response_completeyesLifecycle phase for this publisher.
destinationstringyesHTTP endpoint receiving the structured CloudEvent.
authorizationCloudEventsAuthorizationConfignoOptional environment-backed bearer authorization for the receiver.
authorization.env_varstringyesEnvironment variable containing the bearer token.
deliverybest_effortnoDelivery guarantee supported by this version.
formatstructured_jsonnoHTTP CloudEvents binding used by this publisher.
sourcestringyesStatic CloudEvents source attribute.
typestringyesStatic CloudEvents type attribute.
subjectCloudEventsMappingnoOptional CloudEvents subject attribute.
subject.valuestringyesSource reference: context.*, metadata.*, request_header.*, response_header.*, or response.status.
subject.typestring | integer | boolean | jsonyesOutput conversion to apply.
subject.requiredboolnoWhether failure to resolve this value suppresses the event.
schemastringnoOptional CloudEvents data-schema identifier.
include_provenanceboolnoInclude source-derived provenance in reserved data._praxis_provenance.
context_fieldsstring[]noExplicitly allowlisted context references.
request_headersstring[]noExplicitly allowlisted request header names.
response_headersstring[]noExplicitly allowlisted response header names.
metadata_fieldsstring[]noExplicitly allowlisted filter metadata references.
dataobject<string, CloudEventsMapping>noMapped CloudEvent data fields.
data.valuestringyesSource reference: context.*, metadata.*, request_header.*, response_header.*, or response.status.
data.typestring | integer | boolean | jsonyesOutput conversion to apply.
data.requiredboolnoWhether failure to resolve this value suppresses the event.
extensionsobject<string, CloudEventsMapping>noMapped CloudEvent extension attributes.
extensions.valuestringyesSource reference: context.*, metadata.*, request_header.*, response_header.*, or response.status.
extensions.typestring | integer | boolean | jsonyesOutput conversion to apply.
extensions.requiredboolnoWhether failure to resolve this value suppresses the event.
size_limit_bytesintegernoMaximum serialized event size in bytes (1 through 65536).
delivery_timeout_msintegernoMaximum outbound delivery time in milliseconds.

Example

filter: cloud_events
on: response_complete
destination: https://events.example.net/v1/events
authorization:
  env_var: METERING_AUTH_TOKEN
delivery: best_effort
format: structured_json
source: urn:praxis:gateway
type: inference.tokens.used
size_limit_bytes: 65536
delivery_timeout_ms: 3000
include_provenance: false
context_fields:
  - identity.subject_id
  - identity.claim.group
  - identity.claim.subscription
  - identity.claim.model
  - cluster
request_headers: [user-agent]
metadata_fields:
  - token.input
  - token.output
  - token.total
  - token.cache_read
  - token.cache_write
  - token.reasoning
subject: { value: context.identity.subject_id, type: string, required: true }
data:
  user: { value: context.identity.subject_id, type: string, required: true }
  provider: { value: context.cluster, type: string }
  user_agent: { value: request_header.user-agent, type: string }
  total_tokens: { value: metadata.token.total, type: integer, required: true }