20192019. 3. 15. 13:38

Azure Stream Analytics 에서 입출력과 관련된 오류가 발생했다면 가정 먼저 포털에서 Activity Log 메뉴를 통해 Diagnostics Error를 참조하여 어떤 오류가 있었는지 체크할 수 있습니다.

실제 Input 항목에 Output 과 스키마가 일치하지 않은 데이터를 고의적으로 넣고 job 을 수행했을 때, 아래와 같은 convert  오류를 볼 수 있으나 실제 매개변수로 사용된 원본 데이터는 확인할 수 없습니다.


다른 Azure 대부분의 서비스도 마찬가지지만 이 경우 Diagnostics logs 기능을 켜고 Execution 에 대한 기록을 blob 에 로깅하도록 설정하면 트러블슈팅에 필요한 정보를 얻을 수 있습니다.

아래 로그는 실제 blob 에 기록된 로그 json 포멧의 일부이며 col1 컬럼에 어떤 데이터가 INPUT으로부터 전달되었는지 식별할 수 있습니다.

{ "Environment": "Prod", "Region": "Japan West", "time": "2019-03-15T01:54:54.9580616Z", "resourceId": "/SUBSCRIPTIONS/*/RESOURCEGROUPS/ASA/PROVIDERS/MICROSOFT.STREAMANALYTICS/STREAMINGJOBS/A*O", "operationName": "Send Events", "category": "Execution", "status": "Failed", "level": "Error", "properties": "{\"Message\":\"Encountered error trying to write 1 event(s): Cannot convert from property 'col1' of type 'System.String' to column 'col1' of type 'System.Int32'. By default, Azure Stream Analytics retries writing the event indefinitely until the write succeeds. Consider choosing Skip Output Error Policy to skip such errors, so an error wouldn't block the job progress.\",\"Source\":{\"Name\":\"output\",\"Type\":null},\"Type\":23,\"Data\":\"{\\\"col1\\\":\\\"21344234213412341\\\",\\\"col2\\\":\\\"3.5\\\",\\\"col3\\\":\\\"한글데이터\\\"}\"}"}


아래 참고 링크를 통해서는 Diagnostics 로그를 Log Analytics 로 보낸 후 Kusto 쿼리를 통해서도 로그 관리가 가능합니다.


[참고자료]
Troubleshoot Azure Stream Analytics by using diagnostics logs
https://docs.microsoft.com/en-us/azure/stream-analytics/stream-analytics-job-diagnostic-logs


작성자 : Lai Go / 작성일자: 2019.03.15

Posted by Lai Go