Configuring Azure Monitor#
Add Telemetry Endpoint#
Note
If you would like to use an existing Application Insights and Log Analytics Workspace, navigate to Overview, then JSON View to capture the connection string.
Azure Monitor Setup
Create a new Application Insights Instance.
Log into Microsoft Azure. Click Monitor, then Application Insights.
Under Application Insights, click View, and then +Create.
Choose the appropriate values for Subscription, Resource Group, and Log Analytics Workspace as defined in your tenant.
Click Review + create.
Navigate to
Overview, thenJSON Viewand then capture theConnectionString Value
NVCF Create Telemetry Endpoint#
Additional documentation for creating a Telemetry Endpoint can be found here.
Using NGC, navigate to Cloud Functions, and then click Settings.
Under Telemetry Endpoints, click + Add Endpoint.
Provide an appropriate
NameunderEndpoint Details. (The example below usesazure-monitor-endpoint.)
Click Azure Monitor.
From the copied connection string value from Azure, paste the following values:
Endpoint (IngestionEndpoint) |
|
Instrumentation Key |
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
Live Endpoint |
|
Application ID |
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
Click Logs, then Metrics under Telemetry Type.
Select
HTTPfor the communication protocol.
Click Save Configuration.
Using the CLI, run the following command:
curl -s --location --request POST
'https://api.ngc.nvidia.com/v2/nvcf/telemetries' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer '$NVCF_TOKEN \
--data '{
"endpoint": "YOUR_AZURE_MONITOR_ENDPOINT",
"protocol": "HTTP",
"provider": "AZURE_MONITOR",
"types": [
"LOGS",
"METRICS"
],
"secret": {
"name": "YOUR_NVCF_TELEMETRY_NAME",
"value": {
"instrumentationKey": "YOUR_INSTRUMENTATION_KEY",
"liveEndpoint": "YOUR_LIVE_ENDPOINT",
"applicationId": "YOUR_APPLICATION_ID"
}
}
}'
Get Telemetry ID#
Once the telemetry endpoint is created, we need to capture the telemetryId.
Note
This step is not required for creating the function using the NVCF UI.
echo NVCF_TOKEN="nvapi-xxxxxxxxxxxxxxxxxxxxxx"
Run the following command to get the
telemetryIdof the created Azure Monitor endpoint:
curl -s --location --request GET
'https://api.ngc.nvidia.com/v2/nvcf/telemetries' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer '$NVCF_TOKEN'' | jq
Copy the
telemetryIdfield for the createdazure-monitor-endpoint:
"telemetryId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"name": "azure-monitor-endpoint",
"endpoint": xxx
.
.
"createdAt":xxx
Store the value in a variable called
Telemetry_ID:
export TELEMETRY_ID="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
Environment Variables#
Observability implementation uses environment variables to control Vector behavior and configuration. These variables are set during NVCF function deployment and control how the container processes logs.
Environment Variable |
Possible Values |
Function |
|---|---|---|
VECTOR_OTEL_ACTIVE |
TRUE ; FALSE / Not set |
When TRUE: Container uses Vector for log processing and forwarding to NVCF collector. When FALSE or unset: Container bypasses Vector and runs the Kit App directly using |
VECTOR_CONF_B64 |
Base64 encoded string |
Provides custom Vector configuration via Base64-encoded string |
If you provide your
VECTOR_CONF_B64value, the entrypoint decodes and uses your custom Vector configuration.When not provided, it uses the default configuration from
vector.tomlwhich is copied to the path/opt/vector/static_config.tomlinside the container.
To Base64 encode, use the following command:
base64 -w 0 vector.toml
Container to Function Flow#
Using the CLI:
curl -s -v --location --request POST 'https://api.ngc.nvidia.com/v2/nvcf/functions' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer '$NVCF_TOKEN'' \
--data '{
"name": "'${STREAMING_FUNCTION_NAME:-usd-composer}'",
"inferenceUrl": "'${STREAMING_START_ENDPOINT:-/sign_in}'",
"inferencePort": '${STREAMING_SERVER_PORT:-49100}',
"health": {
"protocol": "HTTP",
"uri": "/v1/streaming/ready",
"port": '${CONTROL_SERVER_PORT:-8111}',
"timeout": "PT10S",
"expectedStatusCode": 200
},
"containerImage": "'$STREAMING_CONTAINER_IMAGE'",
"apiBodyFormat": "CUSTOM",
"description": "'${STREAMING_FUNCTION_NAME:-usd-composer}'",
"functionType": "STREAMING",
"containerEnvironment": [
{"key": "NVDA_KIT_NUCLEUS", "value": "'$NUCLEUS_SERVER'"},
{"key": "OMNI_JWT_ENABLED", "value": "1"},
{"key": "VECTOR_OTEL_ACTIVE", "value": "TRUE"},
{"key": "NVDA_KIT_ARGS", "value":
"--/app/livestream/nvcf/sessionResumeTimeoutSeconds=300"}
],
“telemetries”: {
“logsTelemetryId”: “'$TELEMETRY_ID'”,
"metricsTelemetryId": "'$TELEMETRY_ID'"
}
Using the UI:
Or if Base64 is used:
Verify Telemetry Appears within Azure Monitor#
Sample KQL queries:
For Logs:
AppTraces
| where Properties.function_id == "xxxxxxxxxxxx"
For Metrics:
AppMetrics
| where Properties.function_id == "xxxxxxxxxxxx"