multiline-validation

작성자: microsoft

ama-logs 이미지 변경에 대한 멀티라인 로그 결합 동작을 검증합니다. configmap에서 멀티라인을 활성화하고, OLD(프로덕션) 이미지를 배포하며, 캡처합니다…

npx skills add https://github.com/microsoft/docker-provider --skill multiline-validation

Multi-line Log Stitching A/B Validation

Validates that an ama-logs image change preserves (or improves) multi-line log stitching behavior across Java, Python, Go, and .NET stack traces on both Linux and Windows. Produces a per-language, per-OS A/B comparison table that shows whether the NEW image produces the same row counts, max-lengths, and stitched-vs-single ratios as the OLD image.

This skill is complementary to backdoor-deployment — that skill validates aggregate data volume and resource consumption; this one validates the multi-line parser pipeline specifically. Run both when an image change can affect log parsing (fluent-bit upgrade, parser config edit, output plugin change).

Required Inputs

Confirm with the user; suggest defaults from the most recent run if available.

InputDescriptionExample
Cluster nameAKS cluster with Linux + Windows nodepoolszane-ama-logs-helm-test
OLD image tagCurrent production imageciprod:3.3.0 (Linux) / ciprod:win-3.3.0 (Windows)
NEW image tagTest image from CI buildcidev:3.3.0-6-g1d77401ab-20260506045747
Helm release nameHelm release for ama-logs on the clusterazuremonitor-containers
Helm release namespaceUsually default for the prod chartdefault

Derived Values

Parse from charts/azuremonitor-containerinsights/values.yaml — do not ask the user.

ValueSource
Cluster Resource IDOmsAgent.aksResourceID
Log Analytics Workspace IDOmsAgent.workspaceID
Subscription ID / Resource GroupExtracted from cluster resource ID

General Rules

  • Save the output of each step to MultilineValidationOutput.md in the repo root. Always append; never clear unless explicitly asked.
  • The configmap is the controlled variable — apply it once, then leave it alone for the entire run. If the configmap changes between OLD and NEW snapshots, the comparison is invalid and must be redone.
  • Use the same multiline test job set for both snapshots. Re-deploy fresh job runs after each image swap so log windows are clean.
  • Wait at least 12 minutes after each image deploy before querying ContainerLogV2 (pod restart + ingestion latency).
  • Restore values.yaml and remove the test configmap from the cluster at the end (unless the user wants to keep them).

Procedures

Apply Multiline Configmap

The skill ships its own configmap so behavior is deterministic. Source: test/scenario/multiline/container-azm-ms-agentconfig.yaml if present, otherwise generate inline:

apiVersion: v1
kind: ConfigMap
metadata:
  name: container-azm-ms-agentconfig
  namespace: kube-system
data:
  log-data-collection-settings: |-
    [log_collection_settings]
       [log_collection_settings.stdout]
          enabled = true
       [log_collection_settings.stderr]
          enabled = true
       [log_collection_settings.enable_multiline_logs]
          enabled = "true"
          stacktrace_languages = ["java", "python", "dotnet", "go"]

Apply: kubectl apply -f <path>

Restart both daemonsets so the new config takes effect:

kubectl rollout restart ds/ama-logs ds/ama-logs-windows -n kube-system
kubectl rollout status ds/ama-logs -n kube-system --timeout=180s
kubectl rollout status ds/ama-logs-windows -n kube-system --timeout=180s

Deploy Multiline Test Jobs

The repo ships eight job manifests under test/scenario/multiline/ covering Java, Python, Go, and .NET on both Linux and Windows. Each job emits a mix of single-line app logs and multi-line stack traces in a loop.

kubectl create namespace tenant1 --dry-run=client -o yaml | kubectl apply -f -
kubectl delete jobs -n tenant1 --all
Get-ChildItem test/scenario/multiline/*.yaml | ForEach-Object { kubectl apply -f $_.FullName }
kubectl get jobs -n tenant1

Re-run this block after each image swap so each snapshot has a clean log window.

Windows nodepool note: Windows test pods require an ltsc2022 nodepool. The shipped yamls use mcr.microsoft.com/powershell:lts-nanoserver-ltsc2022 and rely on AKS image-OS scheduling — do not add a hard-coded nodeSelector.

Update Image Tags and Deploy

  1. Edit charts/azuremonitor-containerinsights/values.yaml:
    • imageRepository: "/azuremonitor/containerinsights/<repo>" (ciprod for OLD, cidev for NEW)
    • imageTagLinux: <linux-tag>
    • imageTagWindows: <windows-tag>
  2. Helm upgrade against the existing release name (do not use --install with a different release name — it will fail on owned ServiceAccounts):
    helm upgrade <release-name> ./charts/azuremonitor-containerinsights -n <release-namespace>
    
  3. Record deploy time in UTC (Get-Date -Format 'u' or (Get-Date).ToUniversalTime().ToString('yyyy-MM-ddTHH:mm:ssZ')).
  4. Wait for rollouts:
    kubectl rollout status ds/ama-logs -n kube-system --timeout=180s
    kubectl rollout status ds/ama-logs-windows -n kube-system --timeout=180s
    
  5. Verify the running image:
    kubectl get ds ama-logs -n kube-system -o jsonpath="{range .spec.template.spec.containers[*]}{.name}={.image}{'\n'}{end}"
    kubectl get ds ama-logs-windows -n kube-system -o jsonpath="{.spec.template.spec.containers[0].image}"
    
  6. Wait 12 minutes before querying.

Query Stitching Metrics

Run the per-language stitching KQL via az monitor log-analytics query -w <workspaceId>:

ContainerLogV2
| where TimeGenerated >= datetime('<deployTime+5min>')
| where _ResourceId =~ '<clusterResourceId>'
| where PodNamespace == 'tenant1'
| extend Msg = tostring(LogMessage)         // CRITICAL: dynamic to string
| extend Lines = countof(Msg, '\n') + 1
| extend OS = iif(ContainerName endswith 'win', 'Win', 'Linux')
| extend Lang = replace_string(ContainerName, '-win', '')
| summarize
    Rows=count(),
    MaxLen=max(strlen(Msg)),
    MaxLines=max(Lines),
    Stitched=countif(Lines>1),
    Single=countif(Lines==1)
    by Lang, OS
| order by Lang asc, OS asc

Save the resulting 8-row table (Lang × OS) to the output file under a clearly labeled section (### OLD image snapshot or ### NEW image snapshot).

Compare A/B

Build a single side-by-side table with one row per (Lang, OS) and these columns:

| Lang | OS | OLD Rows | OLD Stitched | OLD Single | NEW Rows | NEW Stitched | NEW Single | OLD MaxLen | NEW MaxLen | Verdict |

Pass criteria (per row):

  1. MaxLen matches exactly between OLD and NEW. A change here means the longest stitched record changed → parser regression.
  2. Stitched / (Stitched + Single) ratio matches within ±2% between OLD and NEW. A drop means stitching is failing for some headers.
  3. Absolute Rows count is not required to match — different snapshot windows naturally produce different totals.

Failure investigation: when a row fails, drill into the specific (Lang, OS) by sampling rows and inspecting LogMessage. Compare the actual stitched output between OLD and NEW for the same source app log shape. Look for header regex changes, continuation regex changes, or new fluent-bit defaults.

Cleanup

  1. Delete the test namespace: kubectl delete namespace tenant1 --wait=false
  2. (Optional) Remove the multiline configmap if the cluster shouldn't keep it: kubectl delete configmap container-azm-ms-agentconfig -n kube-system
  3. Restore values.yaml placeholders:
    • imageRepository: "/azuremonitor/containerinsights/ciprod"
    • imageTagLinux: <image_to_be_deployed_for_linux>
    • imageTagWindows: <image_to_be_deployed_for_windows>
    • Restore any region/cloud placeholders that were swapped during deployment.
  4. Final summary in MultilineValidationOutput.md: pass/fail per row, image tags compared, deploy timestamps, and any investigation findings.

Steps

Phase 1: Setup (once)

  1. Confirm inputs with the user (or use most recent run defaults).
  2. Set kubectl context: kubectl config use-context <cluster name>.
  3. Apply the multiline configmap and restart both daemonsets (see "Apply Multiline Configmap").
  4. Verify multiline parsers are engaged inside the Linux pod:
    kubectl exec -n kube-system <ama-logs-linux-pod> -c ama-logs -- cat /etc/opt/microsoft/docker-cimprov/fluent-bit.conf | grep -i multiline
    
    Expect a [FILTER] Name multiline block with multiline.parser listing the configured languages.

Phase 2: OLD image snapshot

  1. Update values.yaml to the OLD image and helm-upgrade (see "Update Image Tags and Deploy"). Record OLD deploy time.
  2. Verify pods running and image tag matches expectation.
  3. Deploy / re-deploy the multiline test jobs (see "Deploy Multiline Test Jobs").
  4. Wait 12 minutes.
  5. Run the stitching KQL (see "Query Stitching Metrics"). Save as ### OLD image snapshot.

Phase 3: NEW image snapshot

  1. Update values.yaml to the NEW image and helm-upgrade. Record NEW deploy time.
  2. Verify pods running and image tag matches expectation.
  3. Re-deploy the multiline test jobs to start a clean window.
  4. Wait 12 minutes.
  5. Run the stitching KQL again. Save as ### NEW image snapshot.

Phase 4: Compare and report

  1. Build the side-by-side comparison table (see "Compare A/B").
  2. Apply the pass criteria. For any failing row, investigate and document.
  3. Cleanup (see "Cleanup").
  4. Write final pass/fail verdict to MultilineValidationOutput.md.

microsoft의 다른 스킬

oss-growth
microsoft
OSS 성장 해커 페르소나
agent-framework-azure-ai-py
microsoft
Microsoft Agent Framework Python SDK(agent-framework-azure-ai)를 사용하여 Azure AI Foundry 에이전트를 구축합니다. AzureAIAgentsProvider로 지속적 에이전트를 만들 때, 호스팅 도구(코드 인터프리터, 파일 검색, 웹 검색)를 사용할 때, MCP 서버를 통합할 때, 대화 스레드를 관리할 때, 또는 스트리밍 응답을 구현할 때 사용합니다. 함수 도구, 구조화된 출력, 다중 도구 에이전트를 다룹니다.
development
airunway-aks-setup
microsoft
AKS에서 AI Runway 설정 — 빈 클러스터에서 실행 중인 모델까지. 클러스터 검증, 컨트롤러 설치, GPU 평가, 공급자 설정, 첫 배포를 다룹니다. 시기: "AI Runway 설정", "AKS 클러스터 온보딩", "AI Runway 설치", "airunway 설정", "AKS에 모델 배포", "AKS에서 GPU 추론", "AKS에서 KAITO 설정", "AKS에서 LLM 실행", "AKS에서 vLLM", "AKS에서 모델 서빙 설정", "AI Runway 컨트롤러".
devops
appinsights-instrumentation
microsoft
Azure Application Insights로 웹앱을 계측하기 위한 지침입니다. 원격 분석 패턴, SDK 설정, 구성 참조를 제공합니다. WHEN: 앱 계측 방법, App Insights SDK, 원격 분석 패턴, App Insights란 무엇인가, Application Insights 지침, 계측 예시, APM 모범 사례.
devops
applicationinsights-web-ts
microsoft
브라우저/웹 앱을 Application Insights JavaScript SDK(@microsoft/applicationinsights-web)로 계측합니다. Real User Monitoring(RUM) — 페이지 뷰, 클릭, AJAX/fetch 종속성, 예외, 사용자 지정 이벤트, 백엔드 OpenTelemetry 트레이스와 상관관계가 있는 브라우저 측 GenAI 에이전트 트레이스에 사용합니다. SDK Loader Script 및 npm 설정, 프레임워크 확장(React, React Native, Angular), Click Analytics, 텔레메트리 이니셜라이저, 브라우저에서 생성된 에이전트/도구/모델 스팬에 대한 OTel GenAI 의미론적 규칙을 다룹니다.
devops
azure-ai-anomalydetector-java
microsoft
Azure AI Anomaly Detector SDK for Java로 이상 탐지 애플리케이션을 구축하세요. 단변량/다변량 이상 탐지, 시계열 분석 또는 AI 기반 모니터링을 구현할 때 사용하세요.
development
azure-ai-language-conversations-py
microsoft
azure-ai-language-conversations Python SDK를 사용하여 대화형 언어 이해(CLU)를 구현합니다. ConversationAnalysisClient로 대화 의도와 엔터티를 분석하거나, NLP 기능을 구축하거나, 애플리케이션에 언어 이해를 통합할 때 사용합니다.
development
azure-ai-ml-py
microsoft
Azure Machine Learning SDK v2 for Python. ML 작업 영역, 작업, 모델, 데이터 세트, 컴퓨팅 및 파이프라인에 사용합니다. 트리거: "azure-ai-ml", "MLClient", "workspace", "model registry", "training jobs", "datasets".
development