@@ -9,7 +9,7 @@ displayName: chat history, history, chat logs, logs
9
9
ms.service : cognitive-services
10
10
ms.subservice : qna-maker
11
11
ms.topic : conceptual
12
- ms.date : 09/12 /2019
12
+ ms.date : 11/05 /2019
13
13
ms.author : diberry
14
14
---
15
15
@@ -28,15 +28,15 @@ QnA Maker stores all chat logs and other telemetry, if you have enabled App Insi
28
28
``` kusto
29
29
requests
30
30
| where url endswith "generateAnswer"
31
- | project timestamp, id, name , resultCode, duration, performanceBucket
32
- | parse kind = regex name with *"(?i)knowledgebases/"KbId"/generateAnswer"
31
+ | project timestamp, id, url , resultCode, duration, performanceBucket
32
+ | parse kind = regex url with *"(?i)knowledgebases/"KbId"/generateAnswer"
33
33
| join kind= inner (
34
34
traces | extend id = operation_ParentId
35
35
) on id
36
36
| extend question = tostring(customDimensions['Question'])
37
37
| extend answer = tostring(customDimensions['Answer'])
38
38
| extend score = tostring(customDimensions['Score'])
39
- | project timestamp, resultCode, duration, id, question, answer, score, performanceBucket,KbId
39
+ | project timestamp, resultCode, duration, id, question, answer, score, performanceBucket,KbId
40
40
```
41
41
42
42
Select **Run** to run the query.
@@ -48,50 +48,69 @@ QnA Maker stores all chat logs and other telemetry, if you have enabled App Insi
48
48
### Total 90-day traffic
49
49
50
50
```kusto
51
- //Total Traffic
52
- requests
53
- | where url endswith "generateAnswer" and name startswith "POST"
54
- | parse kind = regex name with *"(?i)knowledgebases/"KbId"/generateAnswer"
55
- | summarize ChatCount=count() by bin(timestamp, 1d), KbId
51
+ //Total Traffic
52
+ requests
53
+ | where url endswith "generateAnswer" and name startswith "POST"
54
+ | parse kind = regex url with *"(?i)knowledgebases/"KbId"/generateAnswer"
55
+ | summarize ChatCount=count() by bin(timestamp, 1d), KbId
56
56
```
57
57
58
58
### Total question traffic in a given time period
59
59
60
60
``` kusto
61
- //Total Question Traffic in a given time period
62
- let startDate = todatetime('2018-02-18 ');
63
- let endDate = todatetime('2018-03-12 ');
64
- requests
65
- | where timestamp <= endDate and timestamp >=startDate
66
- | where url endswith "generateAnswer" and name startswith "POST"
67
- | parse kind = regex name with *"(?i)knowledgebases/"KbId"/generateAnswer"
68
- | summarize ChatCount=count() by KbId
61
+ //Total Question Traffic in a given time period
62
+ let startDate = todatetime('2019-01-01 ');
63
+ let endDate = todatetime('2020-12-31 ');
64
+ requests
65
+ | where timestamp <= endDate and timestamp >=startDate
66
+ | where url endswith "generateAnswer" and name startswith "POST"
67
+ | parse kind = regex url with *"(?i)knowledgebases/"KbId"/generateAnswer"
68
+ | summarize ChatCount=count() by KbId
69
69
```
70
70
71
71
### User traffic
72
72
73
73
``` kusto
74
- //User Traffic
75
- requests
76
- | where url endswith "generateAnswer"
77
- | project timestamp, id, name , resultCode, duration
78
- | parse kind = regex name with *"(?i)knowledgebases/"KbId"/generateAnswer"
79
- | join kind= inner (
80
- traces | extend id = operation_ParentId
81
- ) on id
82
- | extend UserId = tostring(customDimensions['UserId'])
83
- | summarize ChatCount=count() by bin(timestamp, 1d), UserId, KbId
74
+ //User Traffic
75
+ requests
76
+ | where url endswith "generateAnswer"
77
+ | project timestamp, id, url , resultCode, duration
78
+ | parse kind = regex url with *"(?i)knowledgebases/"KbId"/generateAnswer"
79
+ | join kind= inner (
80
+ traces | extend id = operation_ParentId
81
+ ) on id
82
+ | extend UserId = tostring(customDimensions['UserId'])
83
+ | summarize ChatCount=count() by bin(timestamp, 1d), UserId, KbId
84
84
```
85
85
86
86
### Latency distribution of questions
87
87
88
88
``` kusto
89
- //Latency distribution of questions
90
- requests
91
- | where url endswith "generateAnswer" and name startswith "POST"
92
- | parse kind = regex name with *"(?i)knowledgebases/"KbId"/generateAnswer"
93
- | project timestamp, id, name, resultCode, performanceBucket, KbId
94
- | summarize count() by performanceBucket, KbId
89
+ //Latency distribution of questions
90
+ requests
91
+ | where url endswith "generateAnswer" and name startswith "POST"
92
+ | parse kind = regex url with *"(?i)knowledgebases/"KbId"/generateAnswer"
93
+ | project timestamp, id, name, resultCode, performanceBucket, KbId
94
+ | summarize count() by performanceBucket, KbId
95
+ ```
96
+
97
+ ### Unanswered questions
98
+
99
+ ``` kusto
100
+ // Unanswered questions
101
+ requests
102
+ | where url endswith "generateAnswer"
103
+ | project timestamp, id, url
104
+ | parse kind = regex url with *"(?i)knowledgebases/"KbId"/generateAnswer"
105
+ | join kind= inner (
106
+ traces | extend id = operation_ParentId
107
+ ) on id
108
+ | extend question = tostring(customDimensions['Question'])
109
+ | extend answer = tostring(customDimensions['Answer'])
110
+ | extend score = tostring(customDimensions['Score'])
111
+ | where score == "0"
112
+ | project timestamp, KbId, question, answer, score
113
+ | order by timestamp desc
95
114
```
96
115
97
116
## Next steps
0 commit comments