You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2022/04/22 12:54:56 UTC

[GitHub] [nifi] kevdoran commented on a diff in pull request #5943: NIFI-9888 Publishing metrics to Log Analytics ocassionally fails

kevdoran commented on code in PR #5943:
URL: https://github.com/apache/nifi/pull/5943#discussion_r856200758


##########
nifi-nar-bundles/nifi-azure-bundle/nifi-azure-reporting-task/src/main/java/org/apache/nifi/reporting/azure/loganalytics/AbstractAzureLogAnalyticsReportingTask.java:
##########
@@ -136,7 +136,7 @@ protected void sendToLogAnalytics(final HttpPost request, final String workspace
 
         final int bodyLength = rawJson.getBytes(UTF8).length;
         final ZonedDateTime zNow = ZonedDateTime.now(ZoneOffset.UTC);
-        final String nowRfc1123 = zNow.format(DateTimeFormatter.RFC_1123_DATE_TIME);
+        final String nowRfc1123 = zNow.format(DateTimeFormatter.ofPattern("EEE, dd MMM yyyy HH:mm:ss O"));

Review Comment:
   Based on my reading of RFC-1123 and the [Azure Log Analytics docs](https://docs.microsoft.com/en-us/rest/api/loganalytics/create-request), I think it would be better to use `GMT` in place of `0` in the tz/offset field
   ```suggestion
           final String nowRfc1123 = zNow.format(DateTimeFormatter.ofPattern("EEE, dd MMM yyyy HH:mm:ss GMT"));
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org