- search - Search traces
- aggregate - Aggregate traces
- getTraceFields - Get trace field definitions
- getTraceById - Get trace by id
- getTraceSpans - Get trace spans
- fetchOptions - Get options for a trace field
- getSpanById - Get span by id
Search traces
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const result = await mistral.beta.observability.traces.search({
tracesRequest: {},
});
console.log(result);
}
run();The standalone function version of this method:
import { MistralCore } from "@mistralai/mistralai/core.js";
import { betaObservabilityTracesSearch } from "@mistralai/mistralai/funcs/betaObservabilityTracesSearch.js";
// Use `MistralCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const mistral = new MistralCore({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const res = await betaObservabilityTracesSearch(mistral, {
tracesRequest: {},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("betaObservabilityTracesSearch failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.SearchTracesV1ObservabilityTracesSearchPostRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<components.GetTraces>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Aggregate traces
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const result = await mistral.beta.observability.traces.aggregate({
aggregationRequest: {
metric: {
measure: "<value>",
aggregation: "p95",
},
},
});
console.log(result);
}
run();The standalone function version of this method:
import { MistralCore } from "@mistralai/mistralai/core.js";
import { betaObservabilityTracesAggregate } from "@mistralai/mistralai/funcs/betaObservabilityTracesAggregate.js";
// Use `MistralCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const mistral = new MistralCore({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const res = await betaObservabilityTracesAggregate(mistral, {
aggregationRequest: {
metric: {
measure: "<value>",
aggregation: "p95",
},
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("betaObservabilityTracesAggregate failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.AggregateTracesV1ObservabilityTracesAggregatePostRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<components.Aggregation>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Get trace field definitions
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const result = await mistral.beta.observability.traces.getTraceFields();
console.log(result);
}
run();The standalone function version of this method:
import { MistralCore } from "@mistralai/mistralai/core.js";
import { betaObservabilityTracesGetTraceFields } from "@mistralai/mistralai/funcs/betaObservabilityTracesGetTraceFields.js";
// Use `MistralCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const mistral = new MistralCore({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const res = await betaObservabilityTracesGetTraceFields(mistral);
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("betaObservabilityTracesGetTraceFields failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<components.GetTraceFields>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Get trace by id
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const result = await mistral.beta.observability.traces.getTraceById({
traceId: "<id>",
});
console.log(result);
}
run();The standalone function version of this method:
import { MistralCore } from "@mistralai/mistralai/core.js";
import { betaObservabilityTracesGetTraceById } from "@mistralai/mistralai/funcs/betaObservabilityTracesGetTraceById.js";
// Use `MistralCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const mistral = new MistralCore({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const res = await betaObservabilityTracesGetTraceById(mistral, {
traceId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("betaObservabilityTracesGetTraceById failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.GetTraceByIdV1ObservabilityTracesTraceIdGetRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<components.GetTrace>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Get trace spans
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const result = await mistral.beta.observability.traces.getTraceSpans({
traceId: "<id>",
});
console.log(result);
}
run();The standalone function version of this method:
import { MistralCore } from "@mistralai/mistralai/core.js";
import { betaObservabilityTracesGetTraceSpans } from "@mistralai/mistralai/funcs/betaObservabilityTracesGetTraceSpans.js";
// Use `MistralCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const mistral = new MistralCore({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const res = await betaObservabilityTracesGetTraceSpans(mistral, {
traceId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("betaObservabilityTracesGetTraceSpans failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.GetTraceSpansV1ObservabilityTracesTraceIdSpansGetRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<components.GetSpans>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Get options for a trace field
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const result = await mistral.beta.observability.traces.fetchOptions({
fieldName: "<value>",
});
console.log(result);
}
run();The standalone function version of this method:
import { MistralCore } from "@mistralai/mistralai/core.js";
import { betaObservabilityTracesFetchOptions } from "@mistralai/mistralai/funcs/betaObservabilityTracesFetchOptions.js";
// Use `MistralCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const mistral = new MistralCore({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const res = await betaObservabilityTracesFetchOptions(mistral, {
fieldName: "<value>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("betaObservabilityTracesFetchOptions failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.GetTraceFieldOptionsV1ObservabilityTracesFieldsFieldNameOptionsGetRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<components.GetTraceFieldOptions>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |
Get span by id
import { Mistral } from "@mistralai/mistralai";
const mistral = new Mistral({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const result = await mistral.beta.observability.traces.getSpanById({
traceId: "<id>",
spanId: "<id>",
});
console.log(result);
}
run();The standalone function version of this method:
import { MistralCore } from "@mistralai/mistralai/core.js";
import { betaObservabilityTracesGetSpanById } from "@mistralai/mistralai/funcs/betaObservabilityTracesGetSpanById.js";
// Use `MistralCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const mistral = new MistralCore({
apiKey: process.env["MISTRAL_API_KEY"] ?? "",
});
async function run() {
const res = await betaObservabilityTracesGetSpanById(mistral, {
traceId: "<id>",
spanId: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("betaObservabilityTracesGetSpanById failed:", res.error);
}
}
run();| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.GetSpanByIdV1ObservabilityTracesTraceIdSpansSpanIdGetRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<components.GetSpan>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.ObservabilityError | 400, 404, 408, 409, 422 | application/json |
| errors.SDKError | 4XX, 5XX | */* |