JMX 사용자 정의 지표

모니터링할 JMX 메트릭을 구성하려면 다음 예시와 같이 에이전트 configuration.yaml 파일을 편집하십시오:

com.instana.plugin.java:
  jmx:
    # JMX is NOT hot-reloaded and needs to be set before a JVM is discovered.
    # Supported attribute types are Number and Boolean
    # delta calculation is only supported for Number
    - object_name: 'java.lang:type=Compilation'
      metrics:
        - attributes: 'TotalCompilationTime'
          type: 'delta' # delta will report the change to the previous second
    - object_name: 'java.lang:type=ClassLoading'
      metrics:
        - attributes: 'LoadedClassCount'
          type: 'absolute' # absolute will report the value as-is

configuration.yaml 예제에서는 두 가지 유형의 메트릭을 지정합니다:

  • delta 카운터와 같이 시간이 지남에 따라 증가하는 값에 사용되며, 이때 상대적인 변화가 중요한 의미를 가집니다.
  • absolute 이 메트릭에 액세스할 때마다 실제 값을 표시하는 데 사용됩니다.

지정된 속성은 (또는 나 와 Integer 같은 하위 Double클래스 중 Number 하나)이거나 숫자를 나타내는 String 여야 합니다.

JVM 대시보드에서 ‘ JMX ’ 지표는 ‘사용자 지정 JMX 지표’ 아래에 표시됩니다.

이 문서는 Java 의 object_nameObjectName API 문서에 명시된 와일드카드 패턴을 포함할 수 있습니다. 다음은 와일드카드 패턴을 사용한 구성의 예시입니다:

com.instana.plugin.java:
  jmx:
    - object_name: 'kafka.*:type=*-metrics,client-id=*,*'
      metrics:
        - attributes: 'incoming-byte-rate'
          type: 'absolute'
        - attributes: 'incoming-byte-total'
          type: 'absolute'
        - attributes: 'outgoing-byte-rate'
          type: 'absolute'
        - attributes: 'outgoing-byte-total'
          type: 'absolute'