본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

Sumo Logic

원문 보기 위키 갱신

Sumo Logic 로그 검색과 메트릭 쿼리 결과를 기준으로 워크로드를 스케일링하는 트리거예요. 로그 쿼리, 단일 메트릭 쿼리, 다중 메트릭 쿼리 세 가지 유형을 지원해요.

출처: 문서

본문

트리거 명세 (Trigger Specification)

이 명세는 Sumo Logic 로그 검색과 메트릭 쿼리를 기준으로 스케일링하는 sumologic 트리거를 설명해요. 이 scaler는 세 가지 다른 쿼리 유형을 지원해요.

  • logs - Sumo Logic 로그 쿼리 결과를 기준으로 스케일링
  • metrics - 단일 Sumo Logic 메트릭 쿼리 결과를 기준으로 스케일링
  • metrics (multi-query) - 여러 결합된 Sumo Logic 메트릭 쿼리를 기준으로 스케일링

다양한 트리거 구성 예시는 다음과 같아요.

Logs Query 예시:

triggers:
- type: sumologic
  metadata:
    host: "https://api.sumologic.com"   # Sumo Logic API endpoint
    queryType: "logs"                   # Type must be "logs"
    query: "_view=my_view | count"      # Your Sumo Logic logs query
    resultField: "_count"               # Field to extract value from
    timerange: "15m"                    # Lookback window
    timezone: "Asia/Kolkata"            # Timezone (e.g., Asia/Kolkata)
    queryAggregator: "Max"              # Aggregation method: Latest, Avg, Sum, Count, Min, Max
    threshold: "1000"                   # Threshold for scaling
  authenticationRef:
    name: keda-trigger-auth-sumologic

단일 Metrics Query 예시:

triggers:
- type: sumologic
  metadata:
    host: "https://api.sumologic.com"
    queryType: "metrics"
    query: "metric=cpu.usage | avg"
    quantization: "15s"
    rollup: "Max"
    timerange: "15m"
    timezone: "Asia/Kolkata"
    queryAggregator: "Max"
    threshold: "50"
    maxRetries: "3"                     # Optional: Maximum retry attempts
    ignoreNullValues: "true"            # Optional: Return 0 instead of an error when the query returns no data
  authenticationRef:
    name: keda-trigger-auth-sumologic

Multi-Metrics Query 예시:

triggers:
- type: sumologic
  metadata:
    host: "https://api.sumologic.com"
    queryType: "metrics"
    query.A: "metric=requests_total | rate"
    query.B: "metric=request_capacity"
    query.C: "(#A / #B) * 100 along service"
    resultQueryRowID: "C"          # Which query result to extract
    quantization: "15s"
    rollup: "Max"
    timerange: "15m"
    timezone: "Asia/Kolkata"
    queryAggregator: "Max"
    threshold: "75"
  authenticationRef:
    name: keda-trigger-auth-sumologic

파라미터 목록은 다음과 같아요.

공통 파라미터:

  • host - Sumo Logic API 엔드포인트 URL이에요. (지역(Geo)에 따라 다름)
  • queryType - 쿼리 유형이에요. (값: logs, metrics)
  • query - Sumo Logic 쿼리예요. (단일 쿼리용)
  • timerange - 쿼리를 평가할 시간 범위예요.
  • timezone - 쿼리 실행을 위한 시간대예요. (기본값: UTC, 선택 사항)
  • queryAggregator - 집계 방법이에요. (값: Latest, Avg, Sum, Count, Min, Max, 기본값: Avg, 선택 사항)
  • threshold - 스케일링 대상 값이에요.
  • maxRetries - API 요청의 최대 재시도 횟수예요. (기본값: 3, 선택 사항)

Logs Query 전용 파라미터:

  • resultField - 스케일링 메트릭을 추출할 쿼리 결과의 필드예요. (queryType이 logs일 때 필수)
  • logsPollingInterval - 로그 검색 작업의 폴링 간격이에요. (기본값: 1s, 선택 사항)

Metrics Query 전용 파라미터:

  • quantization - 데이터 포인트의 세분성(granularity)이에요. (queryType이 metrics일 때 필수)
  • rollup - 메트릭 롤업 유형이에요. (값: Avg, Sum, Min, Max, Count, 기본값: Avg, 선택 사항)
  • ignoreNullValues - true로 설정하면 메트릭 쿼리가 데이터를 반환하지 않을 때 메트릭 값 0을 반환해요. false로 설정하면 메트릭 쿼리가 데이터를 반환하지 않을 때 scaler가 오류를 반환해요. (값: true, false, 기본값: false, 선택 사항)

Multi-Metrics Query 전용 파라미터:

  • query.A, query.B, query.C 등 - 다단계 쿼리로, 이후 쿼리는 이전 쿼리를 참조할 수 있어요. (다중 메트릭 쿼리에는 필수)
  • resultQueryRowID - 스케일링에 사용할 최종 쿼리(A, B, C 등)예요. (다중 메트릭 쿼리에는 필수)

인증 파라미터 (Authentication Parameters)

Sumo Logic에 인증하려면 TriggerAuthentication 리소스를 구성해야 해요.

사전 요구사항:

  • Sumo Logic Access ID와 Access Key

인증은 Kubernetes Secret과 TriggerAuthentication을 함께 조합해 처리돼요.

apiVersion: v1
kind: Secret
metadata:
  name: sumologic-auth-secret
data:
  accessID: <base64-encoded-accessID>
  accessKey: <base64-encoded-accessKey>

---

apiVersion: keda.sh/v1alpha1
kind: TriggerAuthentication
metadata:
  name: keda-trigger-auth-sumologic
spec:
  secretTargetRef:
    - parameter: accessID
      name: sumologic-auth-secret
      key: accessID
    - parameter: accessKey
      name: sumologic-auth-secret
      key: accessKey

예시 (Example)

Sumo Logic 로그 쿼리를 기반으로 자동 스케일링하는 완전한 예시예요.

apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
  name: sumologic-scaledobject
  namespace: default
spec:
  scaleTargetRef:
    name: my-deployment
  triggers:
  - type: sumologic
    metadata:
      host: "https://api.sumologic.com"
      queryType: "logs"
      query: "_view=error_logs | count"
      resultField: "_count"
      timerange: "5m"
      threshold: "100"
    authenticationRef:
      name: keda-trigger-auth-sumologic

참고 (Notes)

  • pollingInterval은 KEDA가 Sumo Logic을 폴링하는 빈도를 제어해요.
  • cooldownPeriod는 KEDA가 스케일 다운 전에 기다리는 시간을 제어해요.
  • MetricType: 이 scaler는 AverageValue와 Value 메트릭 유형을 모두 지원해요.
  • 실행되는 쿼리에 Sumo Logic 사용자가 적절한 액세스 권한을 갖고 있는지 확인하세요.

더 알아보기 (Learn more)

Sumo Logic 로그 및 메트릭 쿼리 결과를 기준으로 스케일링하는 방법을 살펴봤어요. 단일/다중 메트릭 쿼리냐에 따라 설정해야 할 세부 파라미터가 다르다는 점을 기억해 두세요.