Records

Create trace record

POSThttps://cloud-api.calyptia.com/v1/pipelines/{pipelineID}/trace_session/records
Authorization
Path parameters
pipelineID*string (uuid)
Body
type*TraceRecordKind (enum)
1234
trace_id*string
Example: "trace.5"
start_time*integer (int64)

Unix timestamp with seconds precision.

Example: 1658953439
end_time*integer (int64)

Unix timestamp with seconds precision.

Example: 1658953439
plugin_instance*string
Example: "nest.2"
plugin_alias*string
Example: "nest_2"
return_code*integer
records*array of object
Response

Created

Body
id*string (uuid)
sessionID*string (uuid)
createdAt*string (date-time)
Request
const response = await fetch('https://cloud-api.calyptia.com/v1/pipelines/{pipelineID}/trace_session/records', {
    method: 'POST',
    headers: {
      "Authorization": "Bearer <token>",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "type": 1,
      "trace_id": "trace.5",
      "start_time": 1658953439,
      "end_time": 1658953439,
      "plugin_instance": "nest.2",
      "plugin_alias": "nest_2",
      "records": [
        {
          "timestamp": 1658953439,
          "record": "{\n  \"dummy\": \"dummy_0\",\n  \"powered_by\": \"calyptia\",\n  \"data\": {\n    \"key_name\": \"foo\",\n    \"key_cnt\": \"1\"\n  }\n}"
        }
      ]
    }),
});
const data = await response.json();
Response
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "sessionID": "123e4567-e89b-12d3-a456-426614174000",
  "createdAt": "2024-11-21T09:36:53.326Z"
}