ナレッジ ベースに関する分析の取得Get analytics on your knowledge base

QnA Maker サービスの作成中に App Insights を有効にした場合、QnA Maker はすべてのチャット ログとその他のテレメトリを格納します。QnA Maker stores all chat logs and other telemetry, if you have enabled App Insights during the creation of your QnA Maker service. サンプル クエリを実行して、App Insights からチャット ログを取得してみましょう。Run the sample queries to get your chat logs from App Insights.

  1. App Insights リソースに移動します。Go to your App Insights resource.

    Application Insights リソースを選択します

  2. [Log (Analytics)] を選択します。Select Log (Analytics). QnA Maker テレメトリのクエリを実行できる新しいウィンドウが開きます。A new window opens where you can query QnA Maker telemetry.

  3. 次のクエリを貼り付けて、実行します。Paste in the following query and run it.

    requests
    | where url endswith "generateAnswer"
    | project timestamp, id, url, resultCode, duration, performanceBucket
    | parse kind = regex url with *"(?i)knowledgebases/"KbId"/generateAnswer"
    | join kind= inner (
    traces | extend id = operation_ParentId
    ) on id
    | extend question = tostring(customDimensions['Question'])
    | extend answer = tostring(customDimensions['Answer'])
    | extend score = tostring(customDimensions['Score'])
    | project timestamp, resultCode, duration, id, question, answer, score, performanceBucket,KbId
    

    [実行] を選択して、クエリを実行します。Select Run to run the query.

    ユーザーからの質問、回答、スコアを確認するクエリを実行するRun query to determine questions, answers, and score from users

QnA Maker ナレッジ ベースに関する他の分析についてのクエリを実行しますRun queries for other analytics on your QnA Maker knowledge base

90 日間のトラフィックの合計Total 90-day traffic

//Total Traffic
requests
| where url endswith "generateAnswer" and name startswith "POST"
| parse kind = regex url with *"(?i)knowledgebases/"KbId"/generateAnswer"
| summarize ChatCount=count() by bin(timestamp, 1d), KbId

指定の期間における質問トラフィックの合計Total question traffic in a given time period

//Total Question Traffic in a given time period
let startDate = todatetime('2019-01-01');
let endDate = todatetime('2020-12-31');
requests
| where timestamp <= endDate and timestamp >=startDate
| where url endswith "generateAnswer" and name startswith "POST"
| parse kind = regex url with *"(?i)knowledgebases/"KbId"/generateAnswer"
| summarize ChatCount=count() by KbId

ユーザー トラフィックUser traffic

//User Traffic
requests
| where url endswith "generateAnswer"
| project timestamp, id, url, resultCode, duration
| parse kind = regex url with *"(?i)knowledgebases/"KbId"/generateAnswer"
| join kind= inner (
traces | extend id = operation_ParentId
) on id
| extend UserId = tostring(customDimensions['UserId'])
| summarize ChatCount=count() by bin(timestamp, 1d), UserId, KbId

質問の配布の待ち時間Latency distribution of questions

//Latency distribution of questions
requests
| where url endswith "generateAnswer" and name startswith "POST"
| parse kind = regex url with *"(?i)knowledgebases/"KbId"/generateAnswer"
| project timestamp, id, name, resultCode, performanceBucket, KbId
| summarize count() by performanceBucket, KbId

未回答の質問Unanswered questions

// Unanswered questions
requests
| where url endswith "generateAnswer"
| project timestamp, id, url
| parse kind = regex url with *"(?i)knowledgebases/"KbId"/generateAnswer"
| join kind= inner (
traces | extend id = operation_ParentId
) on id
| extend question = tostring(customDimensions['Question'])
| extend answer = tostring(customDimensions['Answer'])
| extend score = tostring(customDimensions['Score'])
| where  score  == "0" and message == "QnAMaker GenerateAnswer"
| project timestamp, KbId, question, answer, score
| order  by timestamp  desc

次のステップNext steps