CI Visibility Logs

Send CI job logs

Send log lines for a CI job over HTTP. See the CI Visibility Pipelines API for submitting the associated pipeline and job events.

A request can contain one log object or an array of up to 1,000 log objects. The maximum uncompressed request body size is 5.1 MiB.

You can stream log lines while a CI job runs or send them after it finishes. After you submit the completed job event, 20 seconds without a new log line marks the job's logs as complete. Lines sent after that may not appear.

A job can have up to 128 additional attributes and 256 tags. Additional attributes are top-level fields with string, number, Boolean, or null values. Nested objects and arrays are rejected. Additional attributes and ddtags apply to all log lines in the job. If an additional attribute has different values on different lines, the first value received is used. Tags supplied on different lines are combined. A job can contain up to 2,000,000 log records or 1 GiB of message bytes in total.

To reduce request size, send gzip-compressed JSON with the Content-Encoding: gzip header. Retry requests after a 408, 429, 500, or 503 response.

post/api/v2/cilogs

Request

Headers

Content-Encoding'identity' | 'gzip'

HTTP header used to compress the JSON request body.

Request body

ddtagsstring

Comma-separated key:value tags. A job can have up to 256 tags, including repeated keys.

job_idstring required

The job event's resource.id, sent through the CI Visibility pipeline API.

line_numberinteger

The line number in the job log. Use 0 or 1 for the first line.

messagestring required

The non-empty log line message.

pipeline_unique_idstring required

The resource.unique_id of the pipeline event, which must also match the job event's resource.pipeline_unique_id.

provider_namestring

The provider name sent with the pipeline event. It defaults to custom when omitted and, when provided, must be non-empty and cannot contain a comma.

section_namestring

The provider-defined section containing this log line, used to display collapsible groups of lines in the CI job log view.

statusstring

The status of this log line. Any string is accepted. Datadog maps non-empty values to a standard log status. See status mapping.

timestampstring date-time

The log line time in RFC 3339 format with an explicit timezone. If omitted, the intake time is used. It can be at most 18 hours in the past or 12 hours in the future.

Example request

[
  {
    "ddtags": "runner:linux,architecture:amd64",
    "job_id": "job-456",
    "line_number": 812,
    "message": "Running go test ./...",
    "pipeline_unique_id": "3eacb6f3-ff04-4e10-8a9c-46e6d054024a",
    "provider_name": "example-provider",
    "section_name": "tests",
    "status": "warn"
  }
]

Response

Request accepted for processing

object required

Changes

Changes to this operation have not been checked yet.