Skip to main content

Receiving logs

Modelbit logs the inputs, responses, runtimes, and other metadata related to your deployments. In addition to viewing the logs in the Modelbit web app you can receive logs using:

  • Webhooks: Modelbit posts logs to an endpoint you maintain
  • Datadog: Modelbit sends logs to your Datadog instance
  • Snowflake: Use Snowflake Snowpipe to ingest logs into your warehouse

Available log fields

The following fields are available in the JSON-formatted log data:

  • deploymentName: The name of the deployment (string).

  • deploymentVersion: The numeric version of the deployment (string).

  • alias: The version alias (e.g. v1.2) or latest if the deployment was called using an alias instead of a numeric version (string|null).

  • branch: The git branch of the deployment (string).

  • batchStartTs: The timestamp, in milliseconds, when this request started (int).

  • batchEndTs: The timestamp, in milliseconds, when this request completed (int).

  • batchDurationMs: The latency of the request (e.g. time experienced by callers of the deployment). It's the difference between batchStartTs and batchEndTs (int).

  • deploymentRuntimesMs: Modelbit may split the list of inputs to deployments over many concurrently-executing instances of the deployment to improve performance. This field shows the individual runtime durations of each instance used in this batch (list[int]).

  • totalDeploymentRuntimeMs: The total time spent running this batch. It's the sum of deploymentRuntimesMs (int).

  • resultCount: The number of results returned (int).

  • results: A list of objects describing the inputs and outputs of this model call (list[object]):

    • id: The input ID supplied during request call. If no ID was supplied, it's the row's index in the result list.
    • inputs: A list of argument sent to the deployment's function (list[any]).
    • output: The value returned from the deployment's function (any).
    • stdout: The text from any print(...) during execution (null|object).
    • subjectId: If called from an endpoint, this is the value of the subjectKey or Supplied key (null|string).
  • source: The origin of the request (rest|snowflake|redshift|tests).

  • error: The error message if one was triggered by the deployment's function (string|null).

  • workspaceId: Your Modelbit workspace ID (string).

  • batchId: The ID of this particular batch (string).

  • apiKeyId: The ID of the key used to call the deployment, if API keys were used (string|null).

  • remoteIp: The IP of the network that called the API, if using the REST API (string|null).

  • privateCloud: True if this batch ran on your private cloud, false if it ran in Modelbit's cloud. (true|false)

If the deployment was called from an endpoint the following additional fields are available:

  • endpointName: The name of the endpoint that received the request that called this deployment (string).
  • experimentId: The experiment name, if configured, the endpoint used for request splitting (string).
  • backendName: The name of the split or mirror that received the request, calling the deployment.

Example log line

Here's an example log line recording a call with two inferences to a deployment named example_deployment.

{
"alias": "latest",
"batchDurationMs": 51,
"batchEndTs": 1676666475202,
"batchId": "2d07f4d3-c774-4da3-bcbd-90323a07866f",
"batchStartTs": 1676666475151,
"branch": "main",
"deploymentName": "example_deployment",
"deploymentRuntimesMs": [20],
"deploymentVersion": "18",
"error": null,
"remoteIp": "1.2.3.4",
"resultCount": 2,
"results": [
{
"id": 0,
"inputs": [2],
"output": { "double": 4, "size": 92853 }
},
{
"id": 1,
"inputs": [4.25],
"output": { "double": 8.5, "size": 340957 }
}
],
"setup_stdout": [{ "text": "Processing batch of 2" }],
"source": "rest",
"totalDeploymentRuntimeMs": 71,
"workspaceId": "ckvtuwc3j004011lvss9mum7a",
"privateCloud": false
}