Skip to contents

Sends OpenLineage events as JSON POST requests. The base url and relative endpoint are joined with one slash; a URL that already ends in the endpoint is not duplicated.

Supply api_key for Authorization: Bearer <key> authentication, or place authentication headers in headers. Supplying both an API key and a custom Authorization header is an error. All custom headers are redacted from httr2 request printing.

HTTP 429, 500, 502, 503, and 504 responses and low-level connection failures are retried up to max_retries times. The delay is the response's Retry-After, in seconds or as an HTTP date, capped at 60 seconds; otherwise it doubles from 1 second up to 30. HTTP 401 and 403 responses are never retried. Redirects are not followed: a 3xx response raises an openlineage_http_error, so that neither the event nor a credential header is sent to another location.

Delivery is at least once. A retry after a timeout, or libcurl resending a request on a connection the server closed, can deliver an event twice, so consumers should deduplicate, as OpenLineage backends do by run ID, event type and event time.

Set verify_tls = FALSE only for controlled development environments; doing so raises an openlineage_insecure_tls_warning.

Value

An R6 HTTP transport object.

See also

Super class

OpenLineageTransport -> HttpTransport

Methods

Inherited methods
  • OpenLineageTransport$close()


HttpTransport$new()

Create an HTTP transport.

Usage

HttpTransport$new(
  url,
  endpoint = "api/v1/lineage",
  api_key = NULL,
  headers = character(),
  timeout = 5,
  verify_tls = TRUE,
  max_retries = 3L
)

Arguments

url

An absolute HTTP or HTTPS base URL.

endpoint

A relative OpenLineage endpoint path.

api_key

An optional bearer API key.

headers

Optional custom headers as a named character vector.

timeout

A request timeout in seconds, between 0.001 and 2147483.

verify_tls

Whether to verify TLS certificates.

max_retries

A non-negative number of retries after the first request attempt.

Returns

A new HttpTransport object.


HttpTransport$emit()

Send an event to the configured OpenLineage HTTP endpoint.

Usage

HttpTransport$emit(event)

Arguments

event

A RunEvent model.

Returns

event, invisibly, after a successful HTTP response.


HttpTransport$print()

Print a redacted transport summary.

Usage

HttpTransport$print(...)

Arguments

...

Unused.

Returns

The transport, invisibly.


HttpTransport$clone()

The objects of this class are cloneable with this method.

Usage

HttpTransport$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

transport <- HttpTransport$new("https://example.com")
transport
#> <HttpTransport>
#>   endpoint: https://example.com/api/v1/lineage
#>   authentication: none