-
Notifications
You must be signed in to change notification settings - Fork 0
/
api-gateway.yml
54 lines (49 loc) · 2.17 KB
/
api-gateway.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Server configuration
server:
port: ${API_GATEWAY_PORT:4000}
# Spring configuration
spring:
profiles:
active: dev
cloud:
gateway:
routes:
# Authentication Server
- id: auth-server
uri: lb://auth-server:5500/ # If the 'url' has a 'lb' scheme (ie lb://my-service), it will use the Spring Cloud LoadBalancerClient to resolve the name.
predicates:
- Path=/auth/** # It is an object that tests if the given request fulfills a given condition.
filters:
- StripPrefix=1 # remove the prefix from the URL before forwarding the request to the service
# Sample Microservice 1
- id: sample-service-1
uri: lb://sample-service-1 # If the 'url' has a 'lb' scheme (ie lb://my-service), it will use the Spring Cloud LoadBalancerClient to resolve the name.
predicates:
- Path=/service-1/** # It is an object that tests if the given request fulfills a given condition.
filters:
- StripPrefix=1 # remove the prefix from the URL before forwarding the request to the service
# Sample Microservice 2
- id: sample-service-2
uri: lb://sample-service-2 # If the 'url' has a 'lb' scheme (ie lb://my-service), it will use the Spring Cloud LoadBalancerClient to resolve the name.
predicates:
- Path=/service-2/** # It is an object that tests if the given request fulfills a given condition.
filters:
- StripPrefix=1 # remove the prefix from the URL before forwarding the request to the service
# Logging configuration
logging:
pattern:
# Take the span id and trace id from the Mapped Diagnostic Context (MDC) and put them into the log message.
level: '%5p [${spring.application.name:},%X{traceId:-},%X{spanId:-}]'
# Management configuration for tracing, metrics, and endpoint exposure
management:
endpoints:
web:
exposure:
include: 'info, health, prometheus'
tracing:
sampling:
# Set trace sampling rate (1.0 = 100% of traces). Adjust based on traffic volume and system capacity.
probability: 1.0
metrics:
tags:
application: ${spring.application.name}