Open gilbertlim opened 1 year ago
As far as I know, default collector header_list_size_max is set to 1K to allow only the size of the headers created by pinpoint agent to prevent possible attack on pinpoint collector servers through headers. If it is necessary to increase the size for your environment, you can always override them with -D options or using external spring properties when starting the collector (or update the values as you did above). If you think it would be valuable to provide additional config values to docker-compose.yml and .env file in our docker project, please send PRs.
In an environment using Istio, if an envoy container is created as a sidecar in the application container where pinpoint-agent operates, the application container communicates with the pintpoint-collector through the envoy proxy.
version
At this time, An HTTP status code 431 error occurs on the client (application-container). 431 code means 'Request Header Fields Too Large'.
Probably because envoy adds multiple headers.
In server(pinpoint-collector), 'Header size exceeded max allowed size' error occurs.
I confirmed that the problem is caused by the difference in 'header max size' configuration of pinpoint-collector and pinpoint-agent.
The error occurred because the header size that pinpoint-agent sends through enovy proxy is larger than the header size that can be accommodated by pinpoint-collector. pinpoint-agent header size (greater than 1K) -> pinpoint-collector header size (1K)
The key to solving the problem is to increase the 'header_list_size_max' of the pinpoint-collector.
There are two solutions.
1.Temporary solution
Like https://github.com/gilbertlim/pinpoint-docker/pull/1 PR, modify pinpoint-collector.properties. Then, when creating an image, the header_list_size_max value of pinpoint-collector is overridden in the configuration.
pinpoint-collector/build/config/pinpoint-collector.properties
You can use the 9ilbert/pinpoint-collector:2.5.1 public image as shown in the example.
2.Solution to change default configuration https://github.com/gilbertlim/pinpoint/commit/06a1ec6f3e386e9b0db200aacc5c72c7c2a88b98
You can fix the error by changing the 'header max size' of the pinpoint-collector in the repository as shown below. Since the gap between header_list_size_max values of pinpoint-agent and pinpoint-collector is large, it seems desirable to reduce the difference or set it equal.
pinpoint-agent
pinpoint/agent/src/main/resources/pinpoint-root.config
pinpoint-collector pinpoint/collector/src/main/resources/pinpoint-collector-grpc-root.properties
Anyway, if you get a 431 HTTP Code error, you can increase the collector's header_list_size_max.