Activate logs from Workflows to Stackdriver - google-cloud-stackdriver

How you correctly send logs to Stackdriver from Google Workflows?
Based on the documentation I've created this:
- logStep1:
call: sys.log
args:
text: "Step 2 launched accordingly"
severity: INFO
The workflow launches and finishes as expected, but, when I go into stackdriver to look for my log entry it doesn't show, only "audited logs" the rest of them is no where to be found.
Google docs states certain steps to look for those logs, but even the the: resource.type="workflows.googleapis.com/Workflows" is marked as incorrect in the stackdriver filter.
I expected to see my text payload under a blue icon (INFO) entry, but alas, is not there.
Did I missed something in my log step?
Resources used:
https://cloud.google.com/workflows/docs/troubleshooting#sending-logs

After re-reading the documentation it states that it requires Log Writer permissions, I thought that permissions will be inherited from the caller, but it is not the case, once has to create an specific service account with all the required permissions, including Log Writer or Log Admin to be able to send information to the Stackdriver event flow.
So, to solve this issue check:
You have a hand made service account not the one that is automatically spawn.
That SA has all the necessary API and permissions to access your endpoints and the Log writing ability.
When a flow is created the created SA must be used (instead of the generated one)
Try it.
I've tested this several times and it works.

Related

Can the relevant log entries be included in Alert emails from Google Cloud Monitoring?

I have a Google Cloud Monitoring custom Metric that measures "errors of interest" in Google Cloud logs for my project, but the Alert emails it generates (threshold > 0) have only generic information, and nothing that's actually specific to the log entry(ies) that are measured by the metric.
Ideally I'd like to have these alert emails include the actual log entries captured by the metric (i.e. the specific log messages that triggered the alert), so I can see the log info right there in the alert email without having to dig through the logs. The "View Incident" and "View Logs" buttons only get me part-way there (still no details about the specific log entries in question).
Is it possible to have these emails include the details of the log entries that triggered the alert?
Example alert email:

Polling Outlook mail folder (inbox) occasionally returns ErrorInvalidMailboxItemId

Something strange occurs that I cannot find the cause or reason for.
I have a loop which polls Inbox for an authorized user every minute. This goes fine for some time, but then I get 404 and error code is ErrorInvalidMailboxItemId (Item Id doesn't belong to the current mailbox.). I for example get this two times and then the polls starts working again.
GET /v1.0/me/mailFolders/xxx/messages?$filter=isRead%20ne%20true&$count=true&$top=10
Nothing that I can see is different between the polls, so I'm baffled why server suddenly returns 404.
Searching for this error mentions shared mailbox, archive and delegated, however this inbox is neither of these, and besides the error should then be consistent which it is not.
Same bearer token used for all the polls, both when it works, then does not and then when it starts working again.
Any ideas why this goes wrong? Or do I have to look for this error and then just retry or ignore the error for some time?
Thanks
I would try the following:
Do a re-try and see if it works
Implement the detailed response logging at the custom application end, isolate the item, make the same API call in MS Graph Explorer and see if it exists, gets the data or not.
Make sure you have necessary permissions to access the shared mailbox, archive mailboxes or the targeted mailboxes etc

Microsoft Healthbot API Get scenario stack information

H, I'm working on a healthcare project which is using Microsoft Healthcare Bot as a tool. I followed the GitHub: https://github.com/Microsoft/HealthBotContainerSample/, and set it up successfully. right now what I can subscribe from the bot is activity property, using the below sample code:
botConnection.postActivity({type: "activity", value: jsonWebToken, from: user, name: "InitAuthenticatedConversation"}).subscribe(function (id) {
});
botConnection.activity$.filter(function(activity)
{
return activity.type === "activity"
})
.subscribe(function (activity)
{
console.log(activity);
});
and the first screenshot is what i get:
However, there is one thing I can't find any corresponding API, if I interact with bot on Azure, there is an Object with contains scenario stack, intent, score and so on (see the screenshot). But I can't find which API can help me retrieve this object,So, how to retrieve the object showing in the watch window?
Unfortunately, it does not look like there is a way in which a trace can be logged outside of the Scenario Designer for the HealthBot. I tested this and it looks like the trace is not emitted by the bot as any sort of event or message activity and only outputs from the bot, itself.
There are a couple avenues you can take, however.
One, if you sign up for Application Insights in Azure and include the Instrumentation Key, then you can log how the application (i.e. bot) is performing. This will capture any trace events emitted by the bot, however, the telemetry is not the same. It will allow you to see when they are occurring. The below screenshot from Azure shows an example.
To add in Application Insights, in your HealthBot in Azure, navigate to Integration => Secrets. You can then add the Instrumentation Key and save. It generally takes a few moments for activity to populate when viewing Application Insights, so be patient.
The second thing you can do is submit a Feature Request on their GitHub repo here requesting trace events be made available externally for logging and inspection.
Additionally, there is a Microsoft TechCommunity that you can participate in. I don't know if it is monitored for issues/requests, but it is worth trying.
Hope of help!

Microsoft Teams Connector (Questions)

I'm trying to figure out the concept of the MS Teams Connectors.
I've created an Incoming Webhook and a ticketing system is sending notifications in the form of "MessageCard" to a specific channel - so far, so good.
If I want to add buttons to this MessageCard, so if an user want to close a specific ticket, how the authentication to the ticket system can be handled?
I've checked and saw that there are "Connectors" for a lot of products. For example there is "Wunderlist" Connector. Once you configure it, it asks for a login and once you actually log-in - you get a list of task and blabla .. etc.
I created a connector, configured manifest.json, sideloaded it in MS Teams and so on .. but in the end I didn't see where exactly I can develop/configure the "login part".
Any help is appreciated!
Here is a screenshot from my demo connector:
While here is a screenshot from Wunderlist Connector:
Check out the sample connector here: https://github.com/OfficeDev/msteams-connector-github. That may be enough to get you going.

Google Admin SDK Report API - Renaming a file from uppercase to lowercase error

Playing with the Google Admin SDK I found out that When one of the users under a Google Apps Unlimited account renames a file to lowercase (i.e. from "Test file" to "test file") I see in the Audit logs an 'Edit' event instead of a 'Rename' event.
Is that intentional or is it a bug?
http://i.stack.imgur.com/hYtQ4.png
I am using the API Explorer from Google to test it developers.google.com/admin-sdk/reports/v1/reference/activities/ and after renaming a file to lowercase this is the entry that the API Explorer returns http://prnt.sc/aacsic
As described in the docs, a single user action can produce multiple events in the log. Check for other events and look for primary_event=true to better understand what the user might have actually done.

Resources