diff --git a/versioned_docs/version-v6.0.0/dashboard/flows/04_import-flow-traces/import flow-via-fa.md b/versioned_docs/version-v6.0.0/dashboard/flows/04_import-flow-traces/import flow-via-fa.md new file mode 100644 index 00000000..d0a6641d --- /dev/null +++ b/versioned_docs/version-v6.0.0/dashboard/flows/04_import-flow-traces/import flow-via-fa.md @@ -0,0 +1,33 @@ +# 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](https://learn.microsoft.com/en-us/azure/azure-monitor/platform/diagnostic-settings) on the target Function App to monitor, to send the [`Function Application Logs`](https://learn.microsoft.com/en-us/azure/azure-monitor/reference/tables/functionapplogs) to the Invictus Event Hub that can import these logs: + +| Event Hub property | Value | +| ------------------ | ------------------------------------------- | +| Namespace | `invictus-{resourcePrefix}-we-sft-evnm` | +| Hub name | `invictus-{resourcePrefix}-functions-evhb` | + +:::tip[automate configuration] +Take a look at [Bicep AVM](https://github.com/Azure/bicep-registry-modules/tree/main/avm/res/insights/diagnostic-setting) 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. + +```csharp +var properties = new Dictionary +{ + ["x-invictus-domain"] = "", + ["x-invictus-service"] = "", + ["x-invictus-action"] = "", + ["x-invictus-version"] = "", + ["x-invictus-Milestone"] = "", + ["x-invictus-EventText"] = "", + ["x-invictus-workflowname"] = "" +}; + +logger.LogInformation(new EventId(0, "InvictusLog"), JsonSerializer.Serialize(properties)); +``` +