From ddc720dbec687ac86f6b3aaf3d1a81c20c748e52 Mon Sep 17 00:00:00 2001 From: Stijn Moreels <9039753+stijnmoreels@users.noreply.github.com> Date: Wed, 16 Jul 2025 07:36:11 +0200 Subject: [PATCH 1/2] docs(flow.trace): add import flow traces via func app page --- .../import flow-via-fa.md | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 versioned_docs/version-v6.0.0/dashboard/flows/04_import-flow-traces/import flow-via-fa.md 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..8bdb8113 --- /dev/null +++ b/versioned_docs/version-v6.0.0/dashboard/flows/04_import-flow-traces/import flow-via-fa.md @@ -0,0 +1,29 @@ +# 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 +logger.LogInformation(new EventId(0, "InvictusLog"), + "{{ \"x-invictus-domain\": \"\"," + + "\"x-invictus-service\": \"\"," + + "\"x-invictus-action\": \"\"," + + "\"x-invictus-version\": \"\"," + + "\"x-invictus-Milestone\": \"\"," + + "\"x-invictus-EventText\": \"\"," + + "\"x-invictus-workflowname\": \"\" }}"); +``` + From b23456b7183224266a2916dff36b722c660bd767 Mon Sep 17 00:00:00 2001 From: Stijn Moreels <9039753+stijnmoreels@users.noreply.github.com> Date: Wed, 16 Jul 2025 09:23:48 +0200 Subject: [PATCH 2/2] Update versioned_docs/version-v6.0.0/dashboard/flows/04_import-flow-traces/import flow-via-fa.md --- .../import flow-via-fa.md | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) 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 index 8bdb8113..d0a6641d 100644 --- 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 @@ -17,13 +17,17 @@ Take a look at [Bicep AVM](https://github.com/Azure/bicep-registry-modules/tree/ 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 -logger.LogInformation(new EventId(0, "InvictusLog"), - "{{ \"x-invictus-domain\": \"\"," + - "\"x-invictus-service\": \"\"," + - "\"x-invictus-action\": \"\"," + - "\"x-invictus-version\": \"\"," + - "\"x-invictus-Milestone\": \"\"," + - "\"x-invictus-EventText\": \"\"," + - "\"x-invictus-workflowname\": \"\" }}"); +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)); ```