Tree BG 1
Tree
Tree
TreeLeaves
TreeLeaves
Cat IdleGrassGrassRockRock

Beta Observability Logs Endpoints

(beta) Observability API - logs.

Search logs

POST /v1/observability/logs/search#

Search logs

200

Successful Response

Playground

Test the endpoints live

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.beta.observability.logs.search(page_size=50, order="desc")

    # Handle response
    print(res)

curl https://api.mistral.ai/v1/observability/logs/search \
 -X POST \
 -H 'Authorization: Bearer YOUR_APIKEY_HERE' \
 -H 'Content-Type: application/json' \
 -d '{}'
import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({
  apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});

async function run() {
  const result = await mistral.beta.observability.logs.search({
    logsRequest: {},
  });

  console.log(result);
}

run();

200

{
  "logs": {}
}

Get log field definitions

GET /v1/observability/logs/fields#

Get log field definitions

200

Successful Response

field_definitions#
*array<OtelFieldDefinition>

Playground

Test the endpoints live

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.beta.observability.logs.list()

    # Handle response
    print(res)

curl https://api.mistral.ai/v1/observability/logs/fields \
 -X GET \
 -H 'Authorization: Bearer YOUR_APIKEY_HERE'
import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({
  apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});

async function run() {
  const result = await mistral.beta.observability.logs.list();

  console.log(result);
}

run();

200

{
  "field_definitions": [
    {
      "label": "approved",
      "name": "My resource",
      "supported_aggregations": [
        "count"
      ],
      "supported_operators": [
        "eq"
      ],
      "type": "ENUM"
    }
  ]
}

Get options for a log field

GET /v1/observability/logs/fields/{field_name}/options#

Get options for a log field

200

Successful Response

options#
*array<string>|null

Playground

Test the endpoints live

from mistralai.client import Mistral
import os


with Mistral(
    api_key=os.getenv("MISTRAL_API_KEY", ""),
) as mistral:

    res = mistral.beta.observability.logs.fetch_options(field_name="<value>")

    # Handle response
    print(res)

curl https://api.mistral.ai/v1/observability/logs/fields/{field_name}/options \
 -X GET \
 -H 'Authorization: Bearer YOUR_APIKEY_HERE'
import { Mistral } from "@mistralai/mistralai";

const mistral = new Mistral({
  apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});

async function run() {
  const result = await mistral.beta.observability.logs.fetchOptions({
    fieldName: "<value>",
  });

  console.log(result);
}

run();

200

{
  "options": null
}