update worker metrics exposure
This commit is contained in:
		
					parent
					
						
							
								a138276c54
							
						
					
				
			
			
				commit
				
					
						9bec5f0104
					
				
			
		
					 7 changed files with 71 additions and 13 deletions
				
			
		|  | @ -29,7 +29,7 @@ | ||||||
|       include_role: |       include_role: | ||||||
|         name: elementweb |         name: elementweb | ||||||
|       tags: |       tags: | ||||||
|         - docker |         - elementweb | ||||||
|       when: matrix_service == "elementweb" |       when: matrix_service == "elementweb" | ||||||
|     - name: Add synapse |     - name: Add synapse | ||||||
|       include_role: |       include_role: | ||||||
|  |  | ||||||
|  | @ -18,16 +18,6 @@ | ||||||
|     - dir |     - dir | ||||||
|     - test |     - test | ||||||
| 
 | 
 | ||||||
| - name: Create nginx log dir |  | ||||||
|   ansible.builtin.file: |  | ||||||
|     path: /home/{{ ansible_user }}/docker_compose/{{ matrix_service }}/nginx |  | ||||||
|     state: directory |  | ||||||
|     owner: "{{ ansible_user }}" |  | ||||||
|     mode: '0755' |  | ||||||
|   tags: |  | ||||||
|     - dir |  | ||||||
|     - test |  | ||||||
| 
 |  | ||||||
| - name: Create nginx config | - name: Create nginx config | ||||||
|   ansible.builtin.template: |   ansible.builtin.template: | ||||||
|     src: "nginx/elementweb.conf" |     src: "nginx/elementweb.conf" | ||||||
|  |  | ||||||
|  | @ -9,3 +9,10 @@ worker_listeners: | ||||||
|       - names: |       - names: | ||||||
|           - client |           - client | ||||||
|           - federation |           - federation | ||||||
|  |   - port: 9000 | ||||||
|  |     type: metrics | ||||||
|  |     tls: false | ||||||
|  |     x_forwarded: true | ||||||
|  |     resources: | ||||||
|  |      - names: [metrics] | ||||||
|  |        compress: false | ||||||
|  |  | ||||||
|  | @ -9,3 +9,10 @@ worker_listeners: | ||||||
|       - names: |       - names: | ||||||
|           - client |           - client | ||||||
|           - federation |           - federation | ||||||
|  |   - port: 9000 | ||||||
|  |     type: metrics | ||||||
|  |     tls: false | ||||||
|  |     x_forwarded: true | ||||||
|  |     resources: | ||||||
|  |      - names: [metrics] | ||||||
|  |        compress: false | ||||||
|  |  | ||||||
|  | @ -9,6 +9,7 @@ services: | ||||||
|       - run |       - run | ||||||
|       - --config-path=/config/homeserver.yaml |       - --config-path=/config/homeserver.yaml | ||||||
|     restart: always |     restart: always | ||||||
|  |     container_name: synapse-main | ||||||
| 
 | 
 | ||||||
|   synapse-worker-generic: |   synapse-worker-generic: | ||||||
|     image: matrixdotorg/synapse:${SYNAPSE_VERSION} |     image: matrixdotorg/synapse:${SYNAPSE_VERSION} | ||||||
|  | @ -24,6 +25,7 @@ services: | ||||||
|     depends_on: |     depends_on: | ||||||
|       - synapse-main |       - synapse-main | ||||||
|     restart: unless-stopped |     restart: unless-stopped | ||||||
|  |     container_name: synapse-worker-generic | ||||||
| 
 | 
 | ||||||
|   synapse-worker-sync: |   synapse-worker-sync: | ||||||
|     image: matrixdotorg/synapse:${SYNAPSE_VERSION} |     image: matrixdotorg/synapse:${SYNAPSE_VERSION} | ||||||
|  | @ -39,6 +41,7 @@ services: | ||||||
|     depends_on: |     depends_on: | ||||||
|       - synapse-main |       - synapse-main | ||||||
|     restart: unless-stopped |     restart: unless-stopped | ||||||
|  |     container_name: synapse-worker-sync | ||||||
| 
 | 
 | ||||||
|   synapse-worker-federation: |   synapse-worker-federation: | ||||||
|     image: matrixdotorg/synapse:${SYNAPSE_VERSION} |     image: matrixdotorg/synapse:${SYNAPSE_VERSION} | ||||||
|  | @ -54,6 +57,7 @@ services: | ||||||
|     depends_on: |     depends_on: | ||||||
|       - synapse-main |       - synapse-main | ||||||
|     restart: unless-stopped |     restart: unless-stopped | ||||||
|  |     container_name: synapse-worker-federation | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|   nginx: |   nginx: | ||||||
|  | @ -66,9 +70,11 @@ services: | ||||||
|       - /ssl:/ssl |       - /ssl:/ssl | ||||||
|       - /mnt/logs/nginx:/var/log/nginx/ |       - /mnt/logs/nginx:/var/log/nginx/ | ||||||
|     restart: unless-stopped |     restart: unless-stopped | ||||||
|  |     container_name: nginx | ||||||
| 
 | 
 | ||||||
|   redis: |   redis: | ||||||
|     image: "redis:latest" |     image: "redis:latest" | ||||||
|     ports: |     ports: | ||||||
|       - "6379:6379/tcp" |       - "6379:6379/tcp" | ||||||
|     restart: "unless-stopped" |     restart: "unless-stopped" | ||||||
|  |     container_name: redis | ||||||
|  |  | ||||||
|  | @ -6,4 +6,22 @@ | ||||||
|     mode: '0644' |     mode: '0644' | ||||||
|   tags: |   tags: | ||||||
|     - files |     - files | ||||||
|     - test | - name: Create nginx dir | ||||||
|  |   ansible.builtin.file: | ||||||
|  |     path: /home/{{ ansible_user }}/docker_compose/{{ matrix_service }}/nginx | ||||||
|  |     state: directory | ||||||
|  |     owner: "{{ ansible_user }}" | ||||||
|  |     mode: '0755' | ||||||
|  |   tags: | ||||||
|  |     - nginx | ||||||
|  |     - dir | ||||||
|  | 
 | ||||||
|  | - name: Create nginx config | ||||||
|  |   ansible.builtin.template: | ||||||
|  |     src: "nginx/synapse.conf" | ||||||
|  |     dest: /home/{{ ansible_user }}/docker_compose/{{ matrix_service }}/nginx/synapse.conf | ||||||
|  |     owner: "{{ ansible_user }}" | ||||||
|  |     mode: '0644' | ||||||
|  |   tags: | ||||||
|  |     - nginx | ||||||
|  |     - synapse | ||||||
|  |  | ||||||
|  | @ -65,7 +65,7 @@ server { | ||||||
|       deny all; |       deny all; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     # Metrics to master |     # Metrics to worker-generic | ||||||
|     location ~ /synapse-worker-generic/metrics { |     location ~ /synapse-worker-generic/metrics { | ||||||
|       proxy_set_header X-Forwarded-For $remote_addr; |       proxy_set_header X-Forwarded-For $remote_addr; | ||||||
|       proxy_set_header X-Forwarded-Proto $scheme; |       proxy_set_header X-Forwarded-Proto $scheme; | ||||||
|  | @ -80,6 +80,36 @@ server { | ||||||
|       deny all; |       deny all; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  |     # Metrics to worker-sync | ||||||
|  |     location ~ /synapse-worker-sync/metrics { | ||||||
|  |       proxy_set_header X-Forwarded-For $remote_addr; | ||||||
|  |       proxy_set_header X-Forwarded-Proto $scheme; | ||||||
|  |       proxy_set_header Host $http_host; | ||||||
|  |       proxy_pass http://synapse-worker-generic:9000; | ||||||
|  | 
 | ||||||
|  |       allow 10.161.228.115; | ||||||
|  |       allow 10.161.228.116; | ||||||
|  |       allow 10.161.228.117; | ||||||
|  |       allow 10.161.228.118; | ||||||
|  |       allow 10.161.228.119; | ||||||
|  |       deny all; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     # Metrics to worker-federation | ||||||
|  |     location ~ /synapse-worker-federation/metrics { | ||||||
|  |       proxy_set_header X-Forwarded-For $remote_addr; | ||||||
|  |       proxy_set_header X-Forwarded-Proto $scheme; | ||||||
|  |       proxy_set_header Host $http_host; | ||||||
|  |       proxy_pass http://synapse-worker-generic:9000; | ||||||
|  | 
 | ||||||
|  |       allow 10.161.228.115; | ||||||
|  |       allow 10.161.228.116; | ||||||
|  |       allow 10.161.228.117; | ||||||
|  |       allow 10.161.228.118; | ||||||
|  |       allow 10.161.228.119; | ||||||
|  |       deny all; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
| 
 | 
 | ||||||
|     # All other matrix/synapse requests go to main |     # All other matrix/synapse requests go to main | ||||||
|     location ~ /_matrix|/_synapse { |     location ~ /_matrix|/_synapse { | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue