Istio Envoy代理记录丢失的文件

时间:2020-01-23 15:28:34

标签: istio envoyproxy

我具有带有活动性探针的Nginx服务,我已启用JSON格式的istio中的envoy日志记录,尽管另一个应用程序能够正确记录,Nginx envoy代理缺少response_code,协议字段其他字段。

export class HomeComponent implements OnInit {

  ngOnInit(): void {
  }

    public source = {
        username: '',
        password: ''
    };

  public metadata = {
    isReadOnly: false,
    propertyAnnotations: [
      {
        name: 'username',
        displayName: 'Username',
        editor: 'Text',
        validators: [ { name: 'NonEmpty' } ]
      },
      {
        name: 'password',
        displayName: 'Password',
        editor: 'Password',
        validators: [ { name: 'NonEmpty' } ]
      }
    ]
  };

nginx.yaml

{"upstream_cluster":"inbound|80|mgmt-80|mgmtCluster","downstream_remote_address":"10.203.128.31:33408","authority":"-","path":"-","protocol":"-","upstream_service_time":"-","upstream_local_address":"127.0.0.1:55290","duration":"0","downstream_local_address":"100.172.68.250:80","upstream_transport_failure_reason":"-","route_name":"-","response_code":"0","user_agent":"-","response_flags":"-","start_time":"2020-01-23T15:02:22.609Z","method":"-","request_id":"-","upstream_host":"127.0.0.1:80","x_forwarded_for":"-","requested_server_name":"-","bytes_received":"114","istio_policy_status":"-","bytes_sent":"844"}

我想念什么吗?

1 个答案:

答案 0 :(得分:0)

这是由您在部署中选择的TCP协议引起的。

...
        ports:
        - containerPort: 80
          name: http
          protocol: TCP
...

根据v1.12.0 documentation使节:

%PROTOCOL%

HTTP

协议。当前是 HTTP / 1.1 HTTP / 2

TCP

未实现(“-”)。

因此出现“-”是因为它未在tcp协议上实现。


您可以尝试将协议更改为HTTPHTTP2

...
        ports:
        - containerPort: 80
          name: http
          protocol: HTTP
...

希望有帮助。