Metrics

Comprehensive guide to managing and retrieving metrics in the View Assistant platform, including performance metrics, SLA monitoring, runtime analytics, and conversation metrics for comprehensive AI assistant monitoring.

Overview

Metrics provide comprehensive monitoring and analytics capabilities for the View Assistant platform. They enable tracking of performance, SLA compliance, runtime statistics, anomaly detection, and conversation-level analytics to optimize AI assistant operations and ensure quality service delivery.

Metrics are managed via the Assistant API at [http|https]://[hostname]:[port]/v1.0/tenants/[tenant-guid]/assistant/metrics and support comprehensive operations including configuration metrics, time-based analytics, performance summaries, SLA monitoring, and conversation metrics for optimal monitoring and optimization workflows.

API Endpoints

Metrics are managed via the Assistant server API at [http|https]://[hostname]:[port]/v1.0/tenants/[tenant-guid]/assistant/metrics

Supported HTTP Methods: GET, POST

Important: All metrics operations require appropriate authentication tokens.

Supported Operations

  • Health Check: Verify the health status of the metrics service
  • Configuration Metrics: Retrieve metrics for assistant configurations
  • Request Metrics: Retrieve metrics for specific requests
  • Time-based Metrics: Retrieve hourly, daily, and 15-minute interval metrics
  • Performance Metrics: Retrieve performance summaries and trends
  • SLA Metrics: Monitor SLA compliance and breaches
  • Runtime Metrics: Retrieve real-time runtime statistics
  • Analysis Metrics: Histogram analysis, tenant comparison, and anomaly detection
  • Conversation Metrics: Retrieve metrics for specific conversations

Health Check

Checks the health status of the Assistant Metrics service using GET /v1.0/tenants/[tenant-guid]/assistant/metrics/health.

curl --location 'http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/assistant/metrics/health' \
--header 'Authorization: ••••••'
import { ViewSdk } from "view-sdk";

const api = new ViewSdk(
  "http://localhost:8000/", //endpoint
  "00000000-0000-0000-0000-000000000000", //tenant Id
  "default" //access key
);

const healthCheck = async () => {
  try {
    const response = await api.ConfigMetrics.healthCheck();
    console.log(response, "Health check completed");
  } catch (err) {
    console.log("Error checking health:", err);
  }
};

healthCheck();
import view_sdk
from view_sdk import assistant
from view_sdk.sdk_configuration import Service

sdk = view_sdk.configure(
    access_key="default",
    base_url="localhost",
    tenant_guid="00000000-0000-0000-0000-000000000000",
    service_ports={Service.DEFAULT: 8000},
)

def healthCheck():
    health = assistant.ConfigMetrics.health_check()
    print("Health Status:")
    print(health)

healthCheck()
using View.Sdk;
using View.Sdk.Assistant;

ViewAssistantSdk sdk = new ViewAssistantSdk(Guid.Parse("00000000-0000-0000-0000-000000000000"), 
                                            "default", 
                                            "http://localhost:8000/");

var health = await sdk.ConfigMetrics.HealthCheck();

Response

Returns the health status of the metrics service.

Read All Configuration Metrics

Retrieves metrics for all assistant configurations using POST /v1.0/tenants/[tenant-guid]/assistant/metrics/configs.

Request Body

{
  "StartDate": "2025-01-01T00:00:00Z",
  "EndDate": "2025-01-15T23:59:59Z"
}
curl --location --request POST 'http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/assistant/metrics/configs' \
--header 'content-type: application/json' \
--header 'Authorization: ••••••' \
--data '{
    "StartDate": "2025-01-01T00:00:00Z",
    "EndDate": "2025-01-15T23:59:59Z"
}'
import { ViewSdk } from "view-sdk";

const api = new ViewSdk(
  "http://localhost:8000/", //endpoint
  "00000000-0000-0000-0000-000000000000", //tenant Id
  "default" //access key
);

const readAllConfigMetrics = async () => {
  try {
    const response = await api.ConfigMetrics.readAll({
      StartDate: "2025-01-01T00:00:00Z",
      EndDate: "2025-01-15T23:59:59Z"
    });
    console.log(response, "Config metrics fetched successfully");
  } catch (err) {
    console.log("Error fetching config metrics:", err);
  }
};

readAllConfigMetrics();
import view_sdk
from view_sdk import assistant
from view_sdk.sdk_configuration import Service

sdk = view_sdk.configure(
    access_key="default",
    base_url="localhost",
    tenant_guid="00000000-0000-0000-0000-000000000000",
    service_ports={Service.DEFAULT: 8000},
)

def readAllConfigMetrics():
    metrics = assistant.ConfigMetrics.read_all(
        StartDate="2025-01-01T00:00:00Z",
        EndDate="2025-01-15T23:59:59Z"
    )
    print("Config Metrics:")
    print(metrics)

readAllConfigMetrics()
using View.Sdk;
using View.Sdk.Assistant;

ViewAssistantSdk sdk = new ViewAssistantSdk(Guid.Parse("00000000-0000-0000-0000-000000000000"), 
                                            "default", 
                                            "http://localhost:8000/");

ConfigMetrics metrics = await sdk.ConfigMetrics.ReadAll(new {
    StartDate = "2025-01-01T00:00:00Z",
    EndDate = "2025-01-15T23:59:59Z"
});

Response

Returns metrics for all configurations:

{
  "ConfigsMetrics": [
    {
      "ConfigGuid": "22222222-2222-2222-2222-222222222222",
      "TenantGuid": "00000000-0000-0000-0000-000000000000",
      "UniqueRequests": 1500,
      "ErrorCount": 25,
      "TotalTokensIn": 500000,
      "TotalTokensOut": 1000000,
      "DateRange": {
        "Start": "2025-01-01T00:00:00Z",
        "End": "2025-01-15T23:59:59Z"
      },
      "ErrorRatePercent": 1.67,
      "AvgTokensInPerRequest": 333.33,
      "AvgTokensOutPerRequest": 666.67,
      "AvgTimeToFirstTokenMs": 150.5,
      "AvgExecutionTimeMs": 2500.0
    }
  ],
  "TotalConfigs": 1,
  "AveragedSummary": {}
}

Read Configuration Metrics

Retrieves metrics for a specific configuration using POST /v1.0/tenants/[tenant-guid]/assistant/metrics/configs/[config-guid].

Request Parameters

  • config-guid (string, Path, Required): GUID of the assistant configuration

Request Body

{
  "StartDate": "2025-01-01T00:00:00Z",
  "EndDate": "2025-01-15T23:59:59Z"
}
curl --location --request POST 'http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/assistant/metrics/configs/22222222-2222-2222-2222-222222222222' \
--header 'content-type: application/json' \
--header 'Authorization: ••••••' \
--data '{
    "StartDate": "2025-01-01T00:00:00Z",
    "EndDate": "2025-01-15T23:59:59Z"
}'
import { ViewSdk } from "view-sdk";

const api = new ViewSdk(
  "http://localhost:8000/", //endpoint
  "00000000-0000-0000-0000-000000000000", //tenant Id
  "default" //access key
);

const readConfigMetrics = async () => {
  try {
    const response = await api.ConfigMetrics.read(
      "22222222-2222-2222-2222-222222222222", // configGuid
      {
        StartDate: "2025-01-01T00:00:00Z",
        EndDate: "2025-01-15T23:59:59Z"
      }
    );
    console.log(response, "Config metrics fetched successfully");
  } catch (err) {
    console.log("Error fetching config metrics:", err);
  }
};

readConfigMetrics();
import view_sdk
from view_sdk import assistant
from view_sdk.sdk_configuration import Service

sdk = view_sdk.configure(
    access_key="default",
    base_url="localhost",
    tenant_guid="00000000-0000-0000-0000-000000000000",
    service_ports={Service.DEFAULT: 8000},
)

def readConfigMetrics():
    metrics = assistant.ConfigMetrics.read(
        config_guid="22222222-2222-2222-2222-222222222222",
        StartDate="2025-01-01T00:00:00Z",
        EndDate="2025-01-15T23:59:59Z"
    )
    print("Config Metrics:")
    print(metrics)

readConfigMetrics()
using View.Sdk;
using View.Sdk.Assistant;

ViewAssistantSdk sdk = new ViewAssistantSdk(Guid.Parse("00000000-0000-0000-0000-000000000000"), 
                                            "default", 
                                            "http://localhost:8000/");

ConfigMetric metric = await sdk.ConfigMetrics.Read(
    "22222222-2222-2222-2222-222222222222",
    new {
        StartDate = "2025-01-01T00:00:00Z",
        EndDate = "2025-01-15T23:59:59Z"
    }
);

Response

Returns metrics for the specified configuration:

{
  "ConfigGuid": "22222222-2222-2222-2222-222222222222",
  "TenantGuid": "00000000-0000-0000-0000-000000000000",
  "UniqueRequests": 1500,
  "ErrorCount": 25,
  "TotalTokensIn": 500000,
  "TotalTokensOut": 1000000,
  "DateRange": {
    "Start": "2025-01-01T00:00:00Z",
    "End": "2025-01-15T23:59:59Z"
  },
  "ErrorRatePercent": 1.67,
  "AvgTokensInPerRequest": 333.33,
  "AvgTokensOutPerRequest": 666.67,
  "AvgTimeToFirstTokenMs": 150.5,
  "AvgExecutionTimeMs": 2500.0
}

Read Request IDs

Retrieves request IDs matching specific criteria using POST /v1.0/tenants/[tenant-guid]/assistant/metrics/requests.

Request Body

{
  "ConfigGuid": "22222222-2222-2222-2222-222222222222",
  "StartDate": "2025-01-01T00:00:00Z",
  "EndDate": "2025-01-15T23:59:59Z",
  "OperationTypes": ["create", "update"],
  "Limit": 100,
  "Offset": 0
}
curl --location --request POST 'http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/assistant/metrics/requests' \
--header 'content-type: application/json' \
--header 'Authorization: ••••••' \
--data '{
    "ConfigGuid": "22222222-2222-2222-2222-222222222222",
    "StartDate": "2025-01-01T00:00:00Z",
    "EndDate": "2025-01-15T23:59:59Z",
    "OperationTypes": ["create", "update"],
    "Limit": 100,
    "Offset": 0
}'
import { ViewSdk } from "view-sdk";

const api = new ViewSdk(
  "http://localhost:8000/", //endpoint
  "00000000-0000-0000-0000-000000000000", //tenant Id
  "default" //access key
);

const readRequestIds = async () => {
  try {
    const response = await api.ConfigMetrics.readRequestIds({
      ConfigGuid: "22222222-2222-2222-2222-222222222222",
      StartDate: "2025-01-01T00:00:00Z",
      EndDate: "2025-01-15T23:59:59Z",
      OperationTypes: ["create", "update"],
      Limit: 100,
      Offset: 0
    });
    console.log(response, "Request IDs fetched successfully");
  } catch (err) {
    console.log("Error fetching request IDs:", err);
  }
};

readRequestIds();
import view_sdk
from view_sdk import assistant
from view_sdk.sdk_configuration import Service

sdk = view_sdk.configure(
    access_key="default",
    base_url="localhost",
    tenant_guid="00000000-0000-0000-0000-000000000000",
    service_ports={Service.DEFAULT: 8000},
)

def readRequestIds():
    response = assistant.ConfigMetrics.read_request_ids(
        ConfigGuid="22222222-2222-2222-2222-222222222222",
        StartDate="2025-01-01T00:00:00Z",
        EndDate="2025-01-15T23:59:59Z",
        OperationTypes=["create", "update"],
        Limit=100,
        Offset=0
    )
    print("Request IDs:")
    print(response)

readRequestIds()
using View.Sdk;
using View.Sdk.Assistant;

ViewAssistantSdk sdk = new ViewAssistantSdk(Guid.Parse("00000000-0000-0000-0000-000000000000"), 
                                            "default", 
                                            "http://localhost:8000/");

RequesIdsResponse response = await sdk.ConfigMetrics.ReadRequestIds(new {
    ConfigGuid = "22222222-2222-2222-2222-222222222222",
    StartDate = "2025-01-01T00:00:00Z",
    EndDate = "2025-01-15T23:59:59Z",
    OperationTypes = new[] { "create", "update" },
    Limit = 100,
    Offset = 0
});

Response

Returns request IDs matching the criteria:

{
  "AssistantRequests": [],
  "TotalCount": 1500,
  "HasMore": true,
  "PageInfo": {},
  "CurrentPageStatusSummary": {}
}

Read Request Metrics

Retrieves metrics for a specific request using GET /v1.0/tenants/[tenant-guid]/assistant/metrics/requests/[request-id].

Request Parameters

  • request-id (string, Path, Required): ID of the request to retrieve metrics for
curl --location 'http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/assistant/metrics/requests/req-123-456' \
--header 'Authorization: ••••••'
import { ViewSdk } from "view-sdk";

const api = new ViewSdk(
  "http://localhost:8000/", //endpoint
  "00000000-0000-0000-0000-000000000000", //tenant Id
  "default" //access key
);

const readRequestMetrics = async () => {
  try {
    const response = await api.ConfigMetrics.readRequest("req-123-456");
    console.log(response, "Request metrics fetched successfully");
  } catch (err) {
    console.log("Error fetching request metrics:", err);
  }
};

readRequestMetrics();
import view_sdk
from view_sdk import assistant
from view_sdk.sdk_configuration import Service

sdk = view_sdk.configure(
    access_key="default",
    base_url="localhost",
    tenant_guid="00000000-0000-0000-0000-000000000000",
    service_ports={Service.DEFAULT: 8000},
)

def readRequestMetrics():
    metrics = assistant.ConfigMetrics.read_request("req-123-456")
    print("Request Metrics:")
    print(metrics)

readRequestMetrics()
using View.Sdk;
using View.Sdk.Assistant;

ViewAssistantSdk sdk = new ViewAssistantSdk(Guid.Parse("00000000-0000-0000-0000-000000000000"), 
                                            "default", 
                                            "http://localhost:8000/");

var metrics = await sdk.ConfigMetrics.ReadRequest("req-123-456");

Response

Returns metrics for the specified request.

Read Hourly Metrics

Retrieves hourly metrics using POST /v1.0/tenants/[tenant-guid]/assistant/metrics/hourly.

Request Body

{
  "OperationType": "create",
  "StartDate": "2025-01-01T00:00:00Z",
  "EndDate": "2025-01-15T23:59:59Z",
  "Limit": 100
}
curl --location --request POST 'http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/assistant/metrics/hourly' \
--header 'content-type: application/json' \
--header 'Authorization: ••••••' \
--data '{
    "OperationType": "create",
    "StartDate": "2025-01-01T00:00:00Z",
    "EndDate": "2025-01-15T23:59:59Z",
    "Limit": 100
}'
import { ViewSdk } from "view-sdk";

const api = new ViewSdk(
  "http://localhost:8000/", //endpoint
  "00000000-0000-0000-0000-000000000000", //tenant Id
  "default" //access key
);

const readHourlyMetrics = async () => {
  try {
    const response = await api.ConfigMetrics.readHourlyMetrics({
      OperationType: "create",
      StartDate: "2025-01-01T00:00:00Z",
      EndDate: "2025-01-15T23:59:59Z",
      Limit: 100
    });
    console.log(response, "Hourly metrics fetched successfully");
  } catch (err) {
    console.log("Error fetching hourly metrics:", err);
  }
};

readHourlyMetrics();
import view_sdk
from view_sdk import assistant
from view_sdk.sdk_configuration import Service

sdk = view_sdk.configure(
    access_key="default",
    base_url="localhost",
    tenant_guid="00000000-0000-0000-0000-000000000000",
    service_ports={Service.DEFAULT: 8000},
)

def readHourlyMetrics():
    metrics = assistant.ConfigMetrics.read_hourly_metrics(
        OperationType="create",
        StartDate="2025-01-01T00:00:00Z",
        EndDate="2025-01-15T23:59:59Z",
        Limit=100
    )
    print("Hourly Metrics:")
    print(metrics)

readHourlyMetrics()
using View.Sdk;
using View.Sdk.Assistant;

ViewAssistantSdk sdk = new ViewAssistantSdk(Guid.Parse("00000000-0000-0000-0000-000000000000"), 
                                            "default", 
                                            "http://localhost:8000/");

HourlyMetricsResponse response = await sdk.ConfigMetrics.ReadHourlyMetrics(new {
    OperationType = "create",
    StartDate = "2025-01-01T00:00:00Z",
    EndDate = "2025-01-15T23:59:59Z",
    Limit = 100
});

Response

Returns hourly metrics:

{
  "Metrics": [],
  "TotalHours": 360
}

Read Daily Metrics

Retrieves daily metrics using POST /v1.0/tenants/[tenant-guid]/assistant/metrics/daily.

Request Body

{
  "OperationType": "create",
  "StartDate": "2025-01-01T00:00:00Z",
  "EndDate": "2025-01-15T23:59:59Z",
  "Limit": 100
}
curl --location --request POST 'http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/assistant/metrics/daily' \
--header 'content-type: application/json' \
--header 'Authorization: ••••••' \
--data '{
    "OperationType": "create",
    "StartDate": "2025-01-01T00:00:00Z",
    "EndDate": "2025-01-15T23:59:59Z",
    "Limit": 100
}'
import { ViewSdk } from "view-sdk";

const api = new ViewSdk(
  "http://localhost:8000/", //endpoint
  "00000000-0000-0000-0000-000000000000", //tenant Id
  "default" //access key
);

const readDailyMetrics = async () => {
  try {
    const response = await api.ConfigMetrics.readDailyMetrics({
      OperationType: "create",
      StartDate: "2025-01-01T00:00:00Z",
      EndDate: "2025-01-15T23:59:59Z",
      Limit: 100
    });
    console.log(response, "Daily metrics fetched successfully");
  } catch (err) {
    console.log("Error fetching daily metrics:", err);
  }
};

readDailyMetrics();
import view_sdk
from view_sdk import assistant
from view_sdk.sdk_configuration import Service

sdk = view_sdk.configure(
    access_key="default",
    base_url="localhost",
    tenant_guid="00000000-0000-0000-0000-000000000000",
    service_ports={Service.DEFAULT: 8000},
)

def readDailyMetrics():
    metrics = assistant.ConfigMetrics.read_daily_metrics(
        OperationType="create",
        StartDate="2025-01-01T00:00:00Z",
        EndDate="2025-01-15T23:59:59Z",
        Limit=100
    )
    print("Daily Metrics:")
    print(metrics)

readDailyMetrics()
using View.Sdk;
using View.Sdk.Assistant;

ViewAssistantSdk sdk = new ViewAssistantSdk(Guid.Parse("00000000-0000-0000-0000-000000000000"), 
                                            "default", 
                                            "http://localhost:8000/");

DailyMetricsResponse response = await sdk.ConfigMetrics.ReadDailyMetrics(new {
    OperationType = "create",
    StartDate = "2025-01-01T00:00:00Z",
    EndDate = "2025-01-15T23:59:59Z",
    Limit = 100
});

Response

Returns daily metrics:

{
  "Metrics": [],
  "TotalDays": 15
}

Read 15-Minute Metrics

Retrieves 15-minute interval metrics using POST /v1.0/tenants/[tenant-guid]/assistant/metrics/15min.

Request Body

{
  "OperationType": "create",
  "StartDate": "2025-01-01T00:00:00Z",
  "EndDate": "2025-01-15T23:59:59Z",
  "Limit": 100
}
curl --location --request POST 'http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/assistant/metrics/15min' \
--header 'content-type: application/json' \
--header 'Authorization: ••••••' \
--data '{
    "OperationType": "create",
    "StartDate": "2025-01-01T00:00:00Z",
    "EndDate": "2025-01-15T23:59:59Z",
    "Limit": 100
}'
import { ViewSdk } from "view-sdk";

const api = new ViewSdk(
  "http://localhost:8000/", //endpoint
  "00000000-0000-0000-0000-000000000000", //tenant Id
  "default" //access key
);

const read15MinMetrics = async () => {
  try {
    const response = await api.ConfigMetrics.read15MinMetrics({
      OperationType: "create",
      StartDate: "2025-01-01T00:00:00Z",
      EndDate: "2025-01-15T23:59:59Z",
      Limit: 100
    });
    console.log(response, "15-minute metrics fetched successfully");
  } catch (err) {
    console.log("Error fetching 15-minute metrics:", err);
  }
};

read15MinMetrics();
import view_sdk
from view_sdk import assistant
from view_sdk.sdk_configuration import Service

sdk = view_sdk.configure(
    access_key="default",
    base_url="localhost",
    tenant_guid="00000000-0000-0000-0000-000000000000",
    service_ports={Service.DEFAULT: 8000},
)

def read15MinMetrics():
    metrics = assistant.ConfigMetrics.read_15_min_metrics(
        OperationType="create",
        StartDate="2025-01-01T00:00:00Z",
        EndDate="2025-01-15T23:59:59Z",
        Limit=100
    )
    print("15-Minute Metrics:")
    print(metrics)

read15MinMetrics()
using View.Sdk;
using View.Sdk.Assistant;

ViewAssistantSdk sdk = new ViewAssistantSdk(Guid.Parse("00000000-0000-0000-0000-000000000000"), 
                                            "default", 
                                            "http://localhost:8000/");

FifteenMinMetricsResponse response = await sdk.ConfigMetrics.Read15MinMetrics(new {
    OperationType = "create",
    StartDate = "2025-01-01T00:00:00Z",
    EndDate = "2025-01-15T23:59:59Z",
    Limit = 100
});

Response

Returns 15-minute interval metrics:

{
  "Metrics": [],
  "TotalIntervals": 1440,
  "IntervalMinutes": 15
}

Read Performance Summary

Retrieves performance summary metrics using GET /v1.0/tenants/[tenant-guid]/assistant/metrics/performance-summary.

Request Parameters

  • hours (number, Query, Optional): Number of hours to look back (default: 24)
curl --location 'http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/assistant/metrics/performance-summary?hours=24' \
--header 'Authorization: ••••••'
import { ViewSdk } from "view-sdk";

const api = new ViewSdk(
  "http://localhost:8000/", //endpoint
  "00000000-0000-0000-0000-000000000000", //tenant Id
  "default" //access key
);

const readPerformanceSummary = async () => {
  try {
    const response = await api.ConfigMetrics.readPerformanceSummary(24);
    console.log(response, "Performance summary fetched successfully");
  } catch (err) {
    console.log("Error fetching performance summary:", err);
  }
};

readPerformanceSummary();
import view_sdk
from view_sdk import assistant
from view_sdk.sdk_configuration import Service

sdk = view_sdk.configure(
    access_key="default",
    base_url="localhost",
    tenant_guid="00000000-0000-0000-0000-000000000000",
    service_ports={Service.DEFAULT: 8000},
)

def readPerformanceSummary():
    summary = assistant.ConfigMetrics.read_performance_summary(hours=24)
    print("Performance Summary:")
    print(summary)

readPerformanceSummary()
using View.Sdk;
using View.Sdk.Assistant;

ViewAssistantSdk sdk = new ViewAssistantSdk(Guid.Parse("00000000-0000-0000-0000-000000000000"), 
                                            "default", 
                                            "http://localhost:8000/");

PerformanceSummaryResponse response = await sdk.ConfigMetrics.ReadPerformanceSummary(24);

Response

Returns performance summary:

{
  "TotalRequests": 1500,
  "SuccessRate": 98.33,
  "AvgExecutionTime": 2500.0,
  "AvgTokensPerSecond": 25.5,
  "AvgTimeToFirstToken": 150.5,
  "TotalTokensIn": 500000,
  "TotalTokensOut": 1000000,
  "PeriodHours": 24
}

Read Performance Trend

Retrieves performance trend metrics using POST /v1.0/tenants/[tenant-guid]/assistant/metrics/performance-trend.

Request Body

{
  "OperationType": "create",
  "Hours": 24
}
curl --location --request POST 'http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/assistant/metrics/performance-trend' \
--header 'content-type: application/json' \
--header 'Authorization: ••••••' \
--data '{
    "OperationType": "create",
    "Hours": 24
}'
import { ViewSdk } from "view-sdk";

const api = new ViewSdk(
  "http://localhost:8000/", //endpoint
  "00000000-0000-0000-0000-000000000000", //tenant Id
  "default" //access key
);

const readPerformanceTrend = async () => {
  try {
    const response = await api.ConfigMetrics.readPerformanceTrend({
      OperationType: "create",
      Hours: 24
    });
    console.log(response, "Performance trend fetched successfully");
  } catch (err) {
    console.log("Error fetching performance trend:", err);
  }
};

readPerformanceTrend();
import view_sdk
from view_sdk import assistant
from view_sdk.sdk_configuration import Service

sdk = view_sdk.configure(
    access_key="default",
    base_url="localhost",
    tenant_guid="00000000-0000-0000-0000-000000000000",
    service_ports={Service.DEFAULT: 8000},
)

def readPerformanceTrend():
    trend = assistant.ConfigMetrics.read_performance_trend(
        OperationType="create",
        Hours=24
    )
    print("Performance Trend:")
    print(trend)

readPerformanceTrend()
using View.Sdk;
using View.Sdk.Assistant;

ViewAssistantSdk sdk = new ViewAssistantSdk(Guid.Parse("00000000-0000-0000-0000-000000000000"), 
                                            "default", 
                                            "http://localhost:8000/");

PerformanceTrendResponse response = await sdk.ConfigMetrics.ReadPerformanceTrend(new {
    OperationType = "create",
    Hours = 24
});

Response

Returns performance trend data:

{
  "TrendData": [],
  "Summary": {
    "TotalRequests": 1500,
    "OverallSuccessRate": 98.33,
    "OverallAvgExecutionTime": 2500.0,
    "OverallAvgTokensPerSecond": 25.5,
    "OverallAvgTimeToFirstToken": 150.5,
    "ExecutionTimeVariability": 500.0,
    "DataPoints": 24,
    "MinAvgExecutionTime": 2000.0,
    "MaxAvgExecutionTime": 3000.0
  },
  "Insights": {
    "IsImproving": true,
    "PerformanceStability": "stable",
    "RequestVolumePattern": "consistent"
  },
  "PeriodHours": 24
}

Read SLA Metrics

Retrieves SLA compliance metrics using POST /v1.0/tenants/[tenant-guid]/assistant/metrics/sla.

Request Body

{
  "OperationType": "create",
  "Service": "assistant",
  "Hours": 24
}
curl --location --request POST 'http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/assistant/metrics/sla' \
--header 'content-type: application/json' \
--header 'Authorization: ••••••' \
--data '{
    "OperationType": "create",
    "Service": "assistant",
    "Hours": 24
}'
import { ViewSdk } from "view-sdk";

const api = new ViewSdk(
  "http://localhost:8000/", //endpoint
  "00000000-0000-0000-0000-000000000000", //tenant Id
  "default" //access key
);

const readSLAMetrics = async () => {
  try {
    const response = await api.ConfigMetrics.readSLAMetrics({
      OperationType: "create",
      Service: "assistant",
      Hours: 24
    });
    console.log(response, "SLA metrics fetched successfully");
  } catch (err) {
    console.log("Error fetching SLA metrics:", err);
  }
};

readSLAMetrics();
import view_sdk
from view_sdk import assistant
from view_sdk.sdk_configuration import Service

sdk = view_sdk.configure(
    access_key="default",
    base_url="localhost",
    tenant_guid="00000000-0000-0000-0000-000000000000",
    service_ports={Service.DEFAULT: 8000},
)

def readSLAMetrics():
    metrics = assistant.ConfigMetrics.read_sla_metrics(
        OperationType="create",
        Service="assistant",
        Hours=24
    )
    print("SLA Metrics:")
    print(metrics)

readSLAMetrics()
using View.Sdk;
using View.Sdk.Assistant;

ViewAssistantSdk sdk = new ViewAssistantSdk(Guid.Parse("00000000-0000-0000-0000-000000000000"), 
                                            "default", 
                                            "http://localhost:8000/");

SLAMetricsResponse response = await sdk.ConfigMetrics.ReadSLAMetrics(new {
    OperationType = "create",
    Service = "assistant",
    Hours = 24
});

Response

Returns SLA metrics:

{
  "TotalRequests": 1500,
  "SLACompliance": {
    "ExecutionTime": {
      "P50": 2400.0,
      "P90": 2800.0,
      "P95": 2900.0,
      "P99": 3000.0
    },
    "TimeToFirstToken": {
      "P50": 140.0,
      "P90": 180.0,
      "P95": 200.0,
      "P99": 250.0
    },
    "TokensPerSecond": {
      "P50": 25.0,
      "P90": 26.0,
      "P95": 26.5,
      "P99": 27.0
    }
  },
  "SuccessRate": 98.33,
  "PeriodHours": 24
}

Read SLA Breaches

Retrieves SLA breach information using POST /v1.0/tenants/[tenant-guid]/assistant/metrics/sla/breaches.

Request Body

{
  "Hours": 24,
  "ExecutionTimeThreshold": 3000.0,
  "TtftThreshold": 200.0,
  "TpsThreshold": 20.0,
  "Limit": 100
}
curl --location --request POST 'http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/assistant/metrics/sla/breaches' \
--header 'content-type: application/json' \
--header 'Authorization: ••••••' \
--data '{
    "Hours": 24,
    "ExecutionTimeThreshold": 3000.0,
    "TtftThreshold": 200.0,
    "TpsThreshold": 20.0,
    "Limit": 100
}'
import { ViewSdk } from "view-sdk";

const api = new ViewSdk(
  "http://localhost:8000/", //endpoint
  "00000000-0000-0000-0000-000000000000", //tenant Id
  "default" //access key
);

const readSLABreaches = async () => {
  try {
    const response = await api.ConfigMetrics.readSLABreaches({
      Hours: 24,
      ExecutionTimeThreshold: 3000.0,
      TtftThreshold: 200.0,
      TpsThreshold: 20.0,
      Limit: 100
    });
    console.log(response, "SLA breaches fetched successfully");
  } catch (err) {
    console.log("Error fetching SLA breaches:", err);
  }
};

readSLABreaches();
import view_sdk
from view_sdk import assistant
from view_sdk.sdk_configuration import Service

sdk = view_sdk.configure(
    access_key="default",
    base_url="localhost",
    tenant_guid="00000000-0000-0000-0000-000000000000",
    service_ports={Service.DEFAULT: 8000},
)

def readSLABreaches():
    breaches = assistant.ConfigMetrics.read_sla_breaches(
        Hours=24,
        ExecutionTimeThreshold=3000.0,
        TtftThreshold=200.0,
        TpsThreshold=20.0,
        Limit=100
    )
    print("SLA Breaches:")
    print(breaches)

readSLABreaches()
using View.Sdk;
using View.Sdk.Assistant;

ViewAssistantSdk sdk = new ViewAssistantSdk(Guid.Parse("00000000-0000-0000-0000-000000000000"), 
                                            "default", 
                                            "http://localhost:8000/");

SLABreachesResponse response = await sdk.ConfigMetrics.ReadSLABreaches(new {
    Hours = 24,
    ExecutionTimeThreshold = 3000.0,
    TtftThreshold = 200.0,
    TpsThreshold = 20.0,
    Limit = 100
});

Response

Returns SLA breaches:

{
  "Breaches": [
    {
      "Timestamp": "2025-01-15T10:30:00Z",
      "OperationType": "create",
      "TenantGuid": "00000000-0000-0000-0000-000000000000",
      "RequestId": "req-123-456",
      "ExecutionTimeMs": 3500.0,
      "TimeToFirstTokenMs": 250.0,
      "TokensPerSecond": 18.5,
      "Status": "HIGH_EXECUTION_TIME",
      "Service": "assistant",
      "BreachType": "HIGH_EXECUTION_TIME"
    }
  ],
  "TotalBreaches": 1,
  "AnalysisPeriodHours": 24,
  "BreachSummary": {
    "FAILURE": 0,
    "HIGH_EXECUTION_TIME": 1
  }
}

Read Runtime Metrics

Retrieves real-time runtime metrics using POST /v1.0/tenants/[tenant-guid]/assistant/metrics/realtime.

Request Body

{
  "OperationType": "create",
  "Minutes": 15
}
curl --location --request POST 'http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/assistant/metrics/realtime' \
--header 'content-type: application/json' \
--header 'Authorization: ••••••' \
--data '{
    "OperationType": "create",
    "Minutes": 15
}'
import { ViewSdk } from "view-sdk";

const api = new ViewSdk(
  "http://localhost:8000/", //endpoint
  "00000000-0000-0000-0000-000000000000", //tenant Id
  "default" //access key
);

const readRuntimeMetrics = async () => {
  try {
    const response = await api.ConfigMetrics.readRuntimeMetrics({
      OperationType: "create",
      Minutes: 15
    });
    console.log(response, "Runtime metrics fetched successfully");
  } catch (err) {
    console.log("Error fetching runtime metrics:", err);
  }
};

readRuntimeMetrics();
import view_sdk
from view_sdk import assistant
from view_sdk.sdk_configuration import Service

sdk = view_sdk.configure(
    access_key="default",
    base_url="localhost",
    tenant_guid="00000000-0000-0000-0000-000000000000",
    service_ports={Service.DEFAULT: 8000},
)

def readRuntimeMetrics():
    metrics = assistant.ConfigMetrics.read_runtime_metrics(
        OperationType="create",
        Minutes=15
    )
    print("Runtime Metrics:")
    print(metrics)

readRuntimeMetrics()
using View.Sdk;
using View.Sdk.Assistant;

ViewAssistantSdk sdk = new ViewAssistantSdk(Guid.Parse("00000000-0000-0000-0000-000000000000"), 
                                            "default", 
                                            "http://localhost:8000/");

RuntimeMetricsResponse response = await sdk.ConfigMetrics.ReadRuntimeMetrics(new {
    OperationType = "create",
    Minutes = 15
});

Response

Returns runtime metrics:

{
  "TotalRequests": 150,
  "RequestsPerMinute": 10.0,
  "SuccessRate": 98.67,
  "ErrorRate": 1.33,
  "AvgExecutionTime": 2450.0,
  "AvgTokensPerSecond": 25.2,
  "AvgTimeToFirstToken": 148.5,
  "TotalTokensIn": 50000,
  "TotalTokensOut": 100000,
  "PeriodMinutes": 15,
  "LatestDataPoint": {}
}

Read Histogram Analysis

Retrieves histogram analysis metrics using POST /v1.0/tenants/[tenant-guid]/assistant/metrics/histogram.

Request Body

{
  "OperationType": "create",
  "Hours": 24
}
curl --location --request POST 'http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/assistant/metrics/histogram' \
--header 'content-type: application/json' \
--header 'Authorization: ••••••' \
--data '{
    "OperationType": "create",
    "Hours": 24
}'
import { ViewSdk } from "view-sdk";

const api = new ViewSdk(
  "http://localhost:8000/", //endpoint
  "00000000-0000-0000-0000-000000000000", //tenant Id
  "default" //access key
);

const readHistogramAnalysis = async () => {
  try {
    const response = await api.ConfigMetrics.readHistogramAnalysis({
      OperationType: "create",
      Hours: 24
    });
    console.log(response, "Histogram analysis fetched successfully");
  } catch (err) {
    console.log("Error fetching histogram analysis:", err);
  }
};

readHistogramAnalysis();
import view_sdk
from view_sdk import assistant
from view_sdk.sdk_configuration import Service

sdk = view_sdk.configure(
    access_key="default",
    base_url="localhost",
    tenant_guid="00000000-0000-0000-0000-000000000000",
    service_ports={Service.DEFAULT: 8000},
)

def readHistogramAnalysis():
    analysis = assistant.ConfigMetrics.read_histogram_analysis(
        OperationType="create",
        Hours=24
    )
    print("Histogram Analysis:")
    print(analysis)

readHistogramAnalysis()
using View.Sdk;
using View.Sdk.Assistant;

ViewAssistantSdk sdk = new ViewAssistantSdk(Guid.Parse("00000000-0000-0000-0000-000000000000"), 
                                            "default", 
                                            "http://localhost:8000/");

HistogramAnalysisResponse response = await sdk.ConfigMetrics.ReadHistogramAnalysis(new {
    OperationType = "create",
    Hours = 24
});

Response

Returns histogram analysis:

{
  "ExecutionTimeDistribution": {},
  "TimeToFirstTokenDistribution": {},
  "TokensPerSecondDistribution": {},
  "TotalRequests": 1500,
  "PeriodHours": 24
}

Read Tenant Comparison

Retrieves tenant comparison metrics using POST /v1.0/tenants/[tenant-guid]/assistant/metrics/tenant-comparison.

Request Body

{
  "TenantGuids": ["11111111-1111-1111-1111-111111111111", "22222222-2222-2222-2222-222222222222"],
  "Hours": 24
}
curl --location --request POST 'http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/assistant/metrics/tenant-comparison' \
--header 'content-type: application/json' \
--header 'Authorization: ••••••' \
--data '{
    "TenantGuids": ["11111111-1111-1111-1111-111111111111", "22222222-2222-2222-2222-222222222222"],
    "Hours": 24
}'
import { ViewSdk } from "view-sdk";

const api = new ViewSdk(
  "http://localhost:8000/", //endpoint
  "00000000-0000-0000-0000-000000000000", //tenant Id
  "default" //access key
);

const readTenantComparison = async () => {
  try {
    const response = await api.ConfigMetrics.readTenantComparison({
      TenantGuids: ["11111111-1111-1111-1111-111111111111", "22222222-2222-2222-2222-222222222222"],
      Hours: 24
    });
    console.log(response, "Tenant comparison fetched successfully");
  } catch (err) {
    console.log("Error fetching tenant comparison:", err);
  }
};

readTenantComparison();
import view_sdk
from view_sdk import assistant
from view_sdk.sdk_configuration import Service

sdk = view_sdk.configure(
    access_key="default",
    base_url="localhost",
    tenant_guid="00000000-0000-0000-0000-000000000000",
    service_ports={Service.DEFAULT: 8000},
)

def readTenantComparison():
    comparison = assistant.ConfigMetrics.read_tenant_comparison(
        TenantGuids=["11111111-1111-1111-1111-111111111111", "22222222-2222-2222-2222-222222222222"],
        Hours=24
    )
    print("Tenant Comparison:")
    print(comparison)

readTenantComparison()
using View.Sdk;
using View.Sdk.Assistant;

ViewAssistantSdk sdk = new ViewAssistantSdk(Guid.Parse("00000000-0000-0000-0000-000000000000"), 
                                            "default", 
                                            "http://localhost:8000/");

TenantComparisonResponse response = await sdk.ConfigMetrics.ReadTenantComparison(new {
    TenantGuids = new[] { "11111111-1111-1111-1111-111111111111", "22222222-2222-2222-2222-222222222222" },
    Hours = 24
});

Response

Returns tenant comparison metrics:

{
  "TenantMetrics": [],
  "ComparisonPeriodHours": 24,
  "TotalTenantsAnalyzed": 2
}

Read 15-Minute Tenant Comparison

Retrieves 15-minute tenant comparison metrics using POST /v1.0/tenants/[tenant-guid]/assistant/metrics/15min-comparison.

Request Body

{
  "TenantGuids": ["11111111-1111-1111-1111-111111111111", "22222222-2222-2222-2222-222222222222"],
  "Hours": 24
}
curl --location --request POST 'http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/assistant/metrics/15min-comparison' \
--header 'content-type: application/json' \
--header 'Authorization: ••••••' \
--data '{
    "TenantGuids": ["11111111-1111-1111-1111-111111111111", "22222222-2222-2222-2222-222222222222"],
    "Hours": 24
}'
import { ViewSdk } from "view-sdk";

const api = new ViewSdk(
  "http://localhost:8000/", //endpoint
  "00000000-0000-0000-0000-000000000000", //tenant Id
  "default" //access key
);

const read15minTenantComparison = async () => {
  try {
    const response = await api.ConfigMetrics.read15minTenantComparison({
      TenantGuids: ["11111111-1111-1111-1111-111111111111", "22222222-2222-2222-2222-222222222222"],
      Hours: 24
    });
    console.log(response, "15-minute tenant comparison fetched successfully");
  } catch (err) {
    console.log("Error fetching 15-minute tenant comparison:", err);
  }
};

read15minTenantComparison();
import view_sdk
from view_sdk import assistant
from view_sdk.sdk_configuration import Service

sdk = view_sdk.configure(
    access_key="default",
    base_url="localhost",
    tenant_guid="00000000-0000-0000-0000-000000000000",
    service_ports={Service.DEFAULT: 8000},
)

def read15minTenantComparison():
    comparison = assistant.ConfigMetrics.read_15min_tenant_comparison(
        TenantGuids=["11111111-1111-1111-1111-111111111111", "22222222-2222-2222-2222-222222222222"],
        Hours=24
    )
    print("15-Minute Tenant Comparison:")
    print(comparison)

read15minTenantComparison()
using View.Sdk;
using View.Sdk.Assistant;

ViewAssistantSdk sdk = new ViewAssistantSdk(Guid.Parse("00000000-0000-0000-0000-000000000000"), 
                                            "default", 
                                            "http://localhost:8000/");

TenantComparison15minResponse response = await sdk.ConfigMetrics.Read15minTenantComparison(new {
    TenantGuids = new[] { "11111111-1111-1111-1111-111111111111", "22222222-2222-2222-2222-222222222222" },
    Hours = 24
});

Response

Returns 15-minute tenant comparison metrics:

{
  "TenantMetrics": [],
  "ComparisonPeriodHours": 24,
  "TotalTenantsAnalyzed": 2,
  "DataGranularity": "15min"
}

Detect Anomalies

Detects anomalies in assistant metrics using POST /v1.0/tenants/[tenant-guid]/assistant/metrics/anomalies.

Request Parameters

  • sensitivity (number, Query, Optional): Sensitivity parameter for anomaly detection (default: 2.0)

Request Body

{
  "OperationType": "create",
  "Hours": 24
}
curl --location --request POST 'http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/assistant/metrics/anomalies?sensitivity=2.0' \
--header 'content-type: application/json' \
--header 'Authorization: ••••••' \
--data '{
    "OperationType": "create",
    "Hours": 24
}'
import { ViewSdk } from "view-sdk";

const api = new ViewSdk(
  "http://localhost:8000/", //endpoint
  "00000000-0000-0000-0000-000000000000", //tenant Id
  "default" //access key
);

const detectAnomalies = async () => {
  try {
    const response = await api.ConfigMetrics.detectAnomalies({
      OperationType: "create",
      Hours: 24
    }, 2.0); // sensitivity
    console.log(response, "Anomalies detected");
  } catch (err) {
    console.log("Error detecting anomalies:", err);
  }
};

detectAnomalies();
import view_sdk
from view_sdk import assistant
from view_sdk.sdk_configuration import Service

sdk = view_sdk.configure(
    access_key="default",
    base_url="localhost",
    tenant_guid="00000000-0000-0000-0000-000000000000",
    service_ports={Service.DEFAULT: 8000},
)

def detectAnomalies():
    anomalies = assistant.ConfigMetrics.detect_anomalies(
        OperationType="create",
        Hours=24,
        sensitivity=2.0
    )
    print("Anomalies:")
    print(anomalies)

detectAnomalies()
using View.Sdk;
using View.Sdk.Assistant;

ViewAssistantSdk sdk = new ViewAssistantSdk(Guid.Parse("00000000-0000-0000-0000-000000000000"), 
                                            "default", 
                                            "http://localhost:8000/");

DetectAnomaliesResponse response = await sdk.ConfigMetrics.DetectAnomalies(new {
    OperationType = "create",
    Hours = 24
}, sensitivity: 2.0);

Response

Returns anomaly detection results:

{
  "anomalies_detected": false,
  "message": "No anomalies detected in the specified time period",
  "hours_analyzed": 24,
  "data_points": 1500
}

Read Conversation Metrics Summary

Retrieves metrics summary for a specific conversation using GET /v1.0/tenants/[tenant-guid]/assistant/metrics/conversations/[conversation-id].

Request Parameters

  • conversation-id (string, Path, Required): ID of the conversation to retrieve metrics for
curl --location 'http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/assistant/metrics/conversations/abc123-def456-ghi789' \
--header 'Authorization: ••••••'
import { ViewSdk } from "view-sdk";

const api = new ViewSdk(
  "http://localhost:8000/", //endpoint
  "00000000-0000-0000-0000-000000000000", //tenant Id
  "default" //access key
);

const readConversationMetricsSummary = async () => {
  try {
    const response = await api.ConfigMetrics.readConversationMetricsSummary("abc123-def456-ghi789");
    console.log(response, "Conversation metrics summary fetched successfully");
  } catch (err) {
    console.log("Error fetching conversation metrics summary:", err);
  }
};

readConversationMetricsSummary();
import view_sdk
from view_sdk import assistant
from view_sdk.sdk_configuration import Service

sdk = view_sdk.configure(
    access_key="default",
    base_url="localhost",
    tenant_guid="00000000-0000-0000-0000-000000000000",
    service_ports={Service.DEFAULT: 8000},
)

def readConversationMetricsSummary():
    summary = assistant.ConfigMetrics.read_conversation_metrics_summary("abc123-def456-ghi789")
    print("Conversation Metrics Summary:")
    print(summary)

readConversationMetricsSummary()
using View.Sdk;
using View.Sdk.Assistant;

ViewAssistantSdk sdk = new ViewAssistantSdk(Guid.Parse("00000000-0000-0000-0000-000000000000"), 
                                            "default", 
                                            "http://localhost:8000/");

ConversationMetricsSummary summary = await sdk.ConfigMetrics.ReadConversationMetricsSummary("abc123-def456-ghi789");

Response

Returns conversation metrics summary:

{
  "ConversationId": "abc123-def456-ghi789",
  "ConfigGuid": "22222222-2222-2222-2222-222222222222",
  "TenantGuid": "00000000-0000-0000-0000-000000000000",
  "TotalRequests": 15,
  "ErrorCount": 0,
  "FirstRequestAt": "2025-01-15T09:00:00Z",
  "LastRequestAt": "2025-01-15T10:30:00Z",
  "AvgExecutionTimeMs": 2500.0,
  "MinExecutionTimeMs": 2000.0,
  "MaxExecutionTimeMs": 3000.0,
  "TotalTokensIn": 5000,
  "TotalTokensOut": 10000,
  "AvgTokensInPerRequest": 333.33,
  "AvgTokensOutPerRequest": 666.67,
  "AvgTimeToFirstTokenMs": 150.5,
  "AvgTokensPerSecond": 25.5,
  "TotalGenerationTimeMs": 37500.0,
  "ErrorRatePercent": 0.0,
  "ConversationDurationSeconds": 5400,
  "OperationTypeBreakdown": [
    {
      "OperationType": "create",
      "RequestCount": 10,
      "ErrorCount": 0,
      "AvgExecutionTimeMs": 2400.0,
      "MinExecutionTimeMs": 2000.0,
      "MaxExecutionTimeMs": 2800.0,
      "TotalTokensIn": 4000,
      "TotalTokensOut": 8000,
      "AvgTimeToFirstTokenMs": 145.0,
      "AvgTokensPerSecond": 25.0
    }
  ]
}

Read Conversation Requests

Retrieves the list of requests for a specific conversation with pagination using GET /v1.0/tenants/[tenant-guid]/assistant/metrics/conversations/[conversation-id]/requests.

Request Parameters

  • conversation-id (string, Path, Required): ID of the conversation to retrieve requests for
  • limit (number, Query, Optional): Maximum number of requests to retrieve (default: 100)
  • offset (number, Query, Optional): Number of requests to skip before starting to collect results (default: 0)
curl --location 'http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/assistant/metrics/conversations/abc123-def456-ghi789/requests?limit=100&offset=0' \
--header 'Authorization: ••••••'
import { ViewSdk } from "view-sdk";

const api = new ViewSdk(
  "http://localhost:8000/", //endpoint
  "00000000-0000-0000-0000-000000000000", //tenant Id
  "default" //access key
);

const readConversationRequests = async () => {
  try {
    const response = await api.ConfigMetrics.readConversationRequests(
      "abc123-def456-ghi789", // conversationId
      100, // limit
      0    // offset
    );
    console.log(response, "Conversation requests fetched successfully");
  } catch (err) {
    console.log("Error fetching conversation requests:", err);
  }
};

readConversationRequests();
import view_sdk
from view_sdk import assistant
from view_sdk.sdk_configuration import Service

sdk = view_sdk.configure(
    access_key="default",
    base_url="localhost",
    tenant_guid="00000000-0000-0000-0000-000000000000",
    service_ports={Service.DEFAULT: 8000},
)

def readConversationRequests():
    requests = assistant.ConfigMetrics.read_conversation_requests(
        conversation_id="abc123-def456-ghi789",
        limit=100,
        offset=0
    )
    print("Conversation Requests:")
    print(requests)

readConversationRequests()
using View.Sdk;
using View.Sdk.Assistant;

ViewAssistantSdk sdk = new ViewAssistantSdk(Guid.Parse("00000000-0000-0000-0000-000000000000"), 
                                            "default", 
                                            "http://localhost:8000/");

ConversationRequest requests = await sdk.ConfigMetrics.ReadConversationRequests(
    "abc123-def456-ghi789",
    limit: 100,
    offset: 0
);

Response

Returns conversation requests:

{
  "ConversationId": "abc123-def456-ghi789",
  "Requests": [
    {
      "RequestId": "req-001",
      "ConversationId": "abc123-def456-ghi789",
      "OperationType": "create",
      "Timestamp": "2025-01-15T09:00:00Z",
      "ExecutionTimeMs": 2500.0,
      "TimeToFirstTokenMs": 150.0,
      "TokensIn": 500,
      "TokensOut": 1000,
      "TokensPerSecond": 25.0,
      "Status": "success",
      "ModelName": "gpt-4",
      "ModelProvider": "openai",
      "AdditionalData": null,
      "GenerationModel": "gpt-4",
      "GenerationProvider": "openai",
      "RerankEnabled": false,
      "ChatOnlyMode": false,
      "ConfigSnapshot": null
    }
  ],
  "TotalCount": 15,
  "HasMore": false,
  "PageInfo": {}
}

Read Config Conversations Metrics

Retrieves metrics for all conversations under a specific assistant configuration using GET /v1.0/tenants/[tenant-guid]/assistant/metrics/configs/[config-guid]/conversations.

Request Parameters

  • config-guid (string, Path, Required): GUID of the assistant configuration
curl --location 'http://localhost:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/assistant/metrics/configs/22222222-2222-2222-2222-222222222222/conversations' \
--header 'Authorization: ••••••'
import { ViewSdk } from "view-sdk";

const api = new ViewSdk(
  "http://localhost:8000/", //endpoint
  "00000000-0000-0000-0000-000000000000", //tenant Id
  "default" //access key
);

const readConfigConversationsMetrics = async () => {
  try {
    const response = await api.ConfigMetrics.readConfigConversationsMetrics("22222222-2222-2222-2222-222222222222");
    console.log(response, "Config conversations metrics fetched successfully");
  } catch (err) {
    console.log("Error fetching config conversations metrics:", err);
  }
};

readConfigConversationsMetrics();
import view_sdk
from view_sdk import assistant
from view_sdk.sdk_configuration import Service

sdk = view_sdk.configure(
    access_key="default",
    base_url="localhost",
    tenant_guid="00000000-0000-0000-0000-000000000000",
    service_ports={Service.DEFAULT: 8000},
)

def readConfigConversationsMetrics():
    metrics = assistant.ConfigMetrics.read_config_conversations_metrics("22222222-2222-2222-2222-222222222222")
    print("Config Conversations Metrics:")
    print(metrics)

readConfigConversationsMetrics()
using View.Sdk;
using View.Sdk.Assistant;

ViewAssistantSdk sdk = new ViewAssistantSdk(Guid.Parse("00000000-0000-0000-0000-000000000000"), 
                                            "default", 
                                            "http://localhost:8000/");

ConversationMetrics metrics = await sdk.ConfigMetrics.ReadConfigConversationsMetrics("22222222-2222-2222-2222-222222222222");

Response

Returns metrics for all conversations under the configuration:

{
  "ConfigGuid": "22222222-2222-2222-2222-222222222222",
  "TenantGuid": "00000000-0000-0000-0000-000000000000",
  "TotalConversations": 50,
  "Conversations": []
}

Best Practices

When managing metrics in the View Assistant platform, consider the following recommendations for optimal monitoring and analytics:

  • Time Range Selection: Choose appropriate time ranges based on your analysis needs - shorter ranges for real-time monitoring, longer ranges for trend analysis
  • Operation Type Filtering: Use OperationType filters to focus on specific operation types for more targeted analysis
  • Pagination: Utilize limit and offset parameters effectively when dealing with large datasets
  • Performance Monitoring: Regularly monitor performance summaries and trends to identify degradation early
  • SLA Compliance: Set up monitoring for SLA metrics and breaches to ensure service quality
  • Anomaly Detection: Use anomaly detection with appropriate sensitivity levels to identify unusual patterns
  • Conversation Analysis: Leverage conversation-level metrics to understand user experience and conversation quality
  • Tenant Comparison: Use tenant comparison metrics to identify performance variations across tenants
  • Real-time Monitoring: Implement real-time runtime metrics for immediate visibility into system performance
  • Histogram Analysis: Use histogram analysis to understand distribution patterns and identify outliers

Next Steps

After successfully managing metrics, you can:

  • Dashboard Creation: Build comprehensive dashboards showing key performance indicators and trends
  • Alerting: Set up alerts based on SLA breaches and anomaly detection
  • Performance Optimization: Use metrics data to identify optimization opportunities and improve AI assistant performance
  • Capacity Planning: Analyze metrics trends to plan for capacity and scaling needs
  • Quality Assurance: Use conversation metrics to ensure quality service delivery
  • Platform Integration: Integrate metrics data with other View platform services for comprehensive analytics