3.9. 메트릭 생성

3scale toolbox를 사용하여 개발자 포털에서 지표를 생성, 업데이트, 나열 및 삭제합니다.

다음 단계를 사용하여 메트릭을 생성합니다.

  • 지표 이름을 제공해야 합니다.
  • system-name 을 재정의하려면 선택적 매개 변수를 사용합니다.
  • 동일한 이름의 지표가 이미 있는 경우 오류 메시지가 표시됩니다.
  • --disabled 플래그를 사용하여 비활성화된 지표를 생성합니다.

    • 기본적으로 활성화되어 있습니다.
참고
  • 서비스 위치 인수는 서비스 참조이며 서비스 ID 또는 서비스 system_name 일 수 있습니다.

    • toolbox는 둘 중 하나를 사용합니다.

다음 명령은 메트릭을 생성합니다.

3scale metric create [opts] <remote> <service> <metric-name>

메트릭을 생성하는 동안 다음 옵션을 사용합니다.

Options
       --description=<value>      Set a metric description
       --disabled                 Disable this metric in all application
                                  plans
    -o --output=<value>           Output format on stdout:
                                  one of json|yaml
    -t --system-name=<value>      Set the application plan system name
       --unit=<value>             Metric unit: default hit

Options for metric
    -c --config-file=<value>      3scale toolbox configuration file:
                                  defaults to $HOME/.3scalerc.yaml
    -h --help                     Print help for this command
    -k --insecure                 Proceed and operate even for server
                                  connections otherwise considered insecure
    -v --version                  Print the version of this command
       --verbose                  Verbose mode

3.9.1. 메트릭 생성 또는 업데이트

다음 단계를 사용하여 새 메트릭이 없는 경우 해당 지표를 생성하거나 기존 지표를 업데이트합니다.

  • 동일한 이름의 지표가 이미 있는 경우 오류 메시지가 표시됩니다.
  • --disabled 플래그를 사용하여 비활성화된 지표를 업데이트합니다.
  • --enabled 플래그를 사용하여 메트릭을 활성화 하도록 업데이트합니다.
참고
  • 서비스 위치 인수는 서비스 참조이며 서비스 ID 또는 서비스 system_name 일 수 있습니다.

    • toolbox는 둘 중 하나를 사용합니다.
  • 지표 위치 인수는 지표 참조이며 지표 ID 또는 system_name 중 하나일 수 있습니다.

    • toolbox는 둘 중 하나를 사용합니다.

다음 명령 목록은 메트릭을 업데이트합니다.

3scale metric apply [opts] <remote> <service> <metric>

메트릭을 업데이트하는 동안 다음 옵션을 사용합니다.

Options
       --description=<value>      Set a metric description
       --disabled                 Disable this metric in all application
                                  plans
       --enabled                  Enable this metric in all application
                                  plans
    -n --name=<value>             This will set the metric name
       --unit=<value>             Metric unit: default hit
    -o --output=<value>           Output format on stdout:
                                  one of json|yaml

Options for metric
    -c --config-file=<value>      3scale toolbox configuration file:
                                  defaults to $HOME/.3scalerc.yaml
    -h --help                     Print help for this command
    -k --insecure                 Proceed and operate even for server
                                  connections otherwise considered insecure
    -v --version                  Print the version of this command
       --verbose                  Verbose mode

3.9.2. 메트릭 나열

다음 명령은 메트릭을 나열합니다.

3scale metric list [opts] <remote> <service>

메트릭을 나열하는 동안 다음 옵션을 사용합니다.

Options
    -o --output=<value>           Output format on stdout:
                                  one of json|yaml

Options for metric
    -c --config-file=<value>      3scale toolbox configuration file:
                                  defaults to $HOME/.3scalerc.yaml
    -h --help                     Print help for this command
    -k --insecure                 Proceed and operate even for server
                                  connections otherwise considered insecure
    -v --version                  Print the version of this command
       --verbose                  Verbose mode

3.9.3. 메트릭 삭제

다음 명령은 메트릭을 삭제합니다.

3scale metric delete [opts] <remote> <service> <metric>

메트릭을 삭제하는 동안 다음 옵션을 사용합니다.

Options for metric
    -c --config-file=<value>      3scale toolbox configuration file:
                                  defaults to $HOME/.3scalerc.yaml
    -h --help                     Print help for this command
    -k --insecure                 Proceed and operate even for server
                                  connections otherwise considered insecure
    -v --version                  Print the version of this command
       --verbose                  Verbose mode