trpc.group/trpc-go/trpc-go@v1.0.3/testdata/trpc_go.yaml (about)

     1  global:                             # global config.
     2    namespace: Development            # environment type, two types: production and development.
     3    env_name: test                    # environment name, names of multiple environments in informal settings.
     4  
     5  server:                                            # server configuration.
     6    app: test                                        # business application name.
     7    server: helloworld                               # service process name.
     8    bin_path: /usr/local/trpc/bin/                   # paths to binary executables and framework configuration files.
     9    conf_path: /usr/local/trpc/conf/                 # paths to business configuration files.
    10    data_path: /usr/local/trpc/data/                 # paths to business data files.
    11    admin:
    12      ip: 127.0.0.1         # ip.
    13      port: 9528            # default: 9028.
    14      read_timeout: 3000    # ms. the timeout setting for the request is accepted and the request information is completely read to prevent slow clients.
    15      write_timeout: 60000  # ms. the timeout setting for processing.
    16      enable_tls: false     # whether to enable TLS, currently not supported.
    17      rpcz:                 # tool that monitors the running state of RPC, recording various things that happen in a rpc.
    18        fraction: 0.0  # sample rate, 0.0 <= fraction <= 1.0.
    19        record_when:
    20          - AND:
    21              - __min_request_size: 30  # record span whose request_size is greater than__min_request_size in bytes.
    22              - __min_response_size: 40  # record span whose response_size is greater than __min_response_size in bytes.
    23          - OR:
    24              - __error_code: 1  # record span whose error codes is 1.
    25              - __error_code: 2  # record span whose error codes is  2.
    26              - __error_message: "unknown" # record span whose error messages contain  "unknown".
    27              - __error_message: "not found" # record span whose error messages contain  "not found".
    28          - NOT: { __rpc_name: "/trpc.app.server.service/method1" }  # record span whose RPCName doesn't contain __rpc_name.
    29          - NOT: # record span whose RPCName doesn't contain "/trpc.app.server.service/method2, or "/trpc.app.server.service/method3".
    30              OR:
    31                - __rpc_name: "/trpc.app.server.service/method2"
    32                - __rpc_name: "/trpc.app.server.service/method3"
    33          - __min_duration: 1000ms  # record span whose duration is greater than __min_duration.
    34          # record span that has the attribute: name1, and name1's value contains "value1"
    35          # valid attribute form: (key, value) only one space character after comma character, and key can't contain comma(',') character.
    36          - __has_attribute: (name1, value1)
    37          # record span that has the attribute: name2, and name2's value contains "value2".
    38          - __has_attribute: (name2, value2)
    39    service:                                         # business service configuration,can have multiple.
    40      - name: trpc.test.helloworld.Greeter1          # the route name of the service.
    41        ip: 127.0.0.1                                # the service listening ip address, can use the placeholder ${ip}, choose one of ip and nic, priority ip.
    42        nic: eth0                                    # the service listening network card address, if configures ip, you don't need to configure it.
    43        port: 8000                                   # the service listening port, can use the placeholder ${port}.
    44        network: tcp                                 # the service listening network type,  tcp or udp.
    45        protocol: trpc                               # application layer protocol, trpc or http.
    46        timeout: 1000                                # maximum request processing time in milliseconds.
    47        idletime: 300000                             # connection idle time in milliseconds.
    48        registry: polaris                            # The service registration method used when the service starts.
    49      - name: trpc.test.helloworld.Greeter2          # the route name of the service.
    50        ip: 127.0.0.1                                # the service listening ip address, can use the placeholder ${ip}, choose one of ip and nic, priority ip.
    51        nic: eth0                                    # the service listening network card address, if configures ip, you don't need to configure it.
    52        port: 8080                                   # the service listening port, can use the placeholder ${port}.
    53        network: tcp                                 # the service listening network type,  tcp or udp.
    54        protocol: http                               # application layer protocol, trpc or http.
    55        timeout: 1000                                # maximum request processing time in milliseconds.
    56        idletime: 300000                             # connection idle time in milliseconds.
    57        registry: polaris                            # The service registration method used when the service starts.
    58        max_routines: 1000
    59      - name: trpc.test.helloworld.Greeter3          # the route name of the service.
    60        ip: 127.0.0.1                                # the service listening ip address, can use the placeholder ${ip}, choose one of ip and nic, priority ip.
    61        nic: eth0                                    # the service listening network card address, if configures ip, you don't need to configure it.
    62        port: 8090                                   # the service listening port, can use the placeholder ${port}.
    63        network: tcp                                 # the service listening network type,  tcp or udp.
    64        protocol: http                               # application layer protocol, trpc or http.
    65        timeout: 1000                                # maximum request processing time in milliseconds.
    66        idletime: 300000                             # connection idle time in milliseconds.
    67  client:                                            # configuration for client calls.
    68    timeout: 1000                                    # maximum request processing time for all backends.
    69    service:                                         # configuration for a single backend.
    70      - name: trpc.test.helloworld.Greeter1          # backend service name.
    71        namespace: Development                       # backend service environment.
    72        network: tcp                                 # backend service network type, tcp or udp, configuration takes precedence.
    73        protocol: trpc                               # application layer protocol, trpc or http.
    74        timeout: 800                                 # maximum request processing time in milliseconds.
    75      - name: trpc.test.helloworld.Greeter2          # backend service name.
    76        namespace: Production                        # backend service environment.
    77        network: tcp                                 # backend service network type, tcp or udp, configuration takes precedence.
    78        protocol: http                               # application layer protocol, trpc or http.
    79        timeout: 2000                                # maximum request processing time in milliseconds.