Skip to main content

Import flow traces via Azure Function App logs

Invictus allows developers to import flow traces via application logs coming from Azure Function Apps. These logs translate to the startup of the Function App, but can also contain developer-custom logging. Combined, they result in an execution tree in the Dashboard that represents.

Send diagnostic traces from Function App

Configure the diagnostic settings on the target Function App to monitor, to send the Function Application Logs to the Invictus Event Hub that can import these logs:

Event Hub propertyValue
Namespaceinvictus-{resourcePrefix}-we-sft-evnm
Hub nameinvictus-{resourcePrefix}-functions-evhb
automate configuration

Take a look at Bicep AVM to automate this diagnostic setting configuration in your deployment.

Log custom information from Function App

Besides the default application logs, Invictus can extract custom information from custom logs. These logs are indicated with the EventName=InvictusLog. Invictus assumes that the log message is a JSON object. The following JSON properties can be used to set customer information on all (including default) application logs, which can be used to map the entire set of application logs to pre-defined flows in the Dashboard.

var properties = new Dictionary<string, string>
{
["x-invictus-domain"] = "<domain>",
["x-invictus-service"] = "<service>",
["x-invictus-action"] = "<action>",
["x-invictus-version"] = "<version>",
["x-invictus-Milestone"] = "<milestone>",
["x-invictus-EventText"] = "<event-text>",
["x-invictus-workflowname"] = "<workflow-name>"
};

logger.LogInformation(new EventId(0, "InvictusLog"), JsonSerializer.Serialize(properties));