Skip to content

Commit 1daa2a1

Browse files
authored
Merge pull request #158 from Alonza0314/feat/prometheus
Feat/prometheus
2 parents 34affa9 + c9ce93f commit 1daa2a1

16 files changed

+250
-29
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,30 @@ docker compose -f docker-compose-ulcl.yaml up
143143

144144
Check out the used configuration files at `config/ULCL`.
145145

146+
## Prometheous & Grafana
147+
148+
To start the core with Prometheous and Grafana, we need external compose service file to start with our core compose:
149+
150+
```bash
151+
docker compose -f docker-compose.yaml -f docker-compose-prometheus.yaml up
152+
```
153+
154+
Please make sure the metrics secions are enabled in NFs' config, it is disabled in default:
155+
156+
```yaml
157+
# Metrics configuration
158+
# If using the same bindingIPv4 as the sbi server, make sure that the ports are different
159+
metrics:
160+
=> enable: true # (Optional, default false)
161+
scheme: http # (Required) the protocol for metrics (http or https, default https)
162+
bindingIPv4: amf.free5gc.org # (Required) IP used to bind the metrics endpoint (default 0.0.0.0)
163+
port: 9091 # (Optional, default 9091) port used to bind the service
164+
tls: # (Optional) the local path of TLS key (Could be the same as the sbi ones)
165+
pem: /home/sam/private-network/code/free5gc/cert/amf.pem # AMF TLS Certificate
166+
key: /home/sam/private-network/code/free5gc/cert/amf.key # AMF TLS Private key
167+
namespace: free5gc # (Optional, default free5gc)
168+
```
169+
146170
## Reference
147171

148172
- https://github.com/open5gs/nextepc/tree/master/docker

config/amfcfg.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,18 @@ configuration:
119119
maxInitTimeout: 2 # the maximum init timeout of each sctp connection
120120
defaultUECtxReq: false # the default value of UE Context Request to decide when triggering Initial Context Setup procedure
121121

122+
# Metrics configuration
123+
# If using the same bindingIPv4 as the sbi server, make sure that the ports are different
124+
metrics:
125+
enable: false # (Optional, default false)
126+
scheme: http # (Required) the protocol for metrics (http or https, default https)
127+
bindingIPv4: amf.free5gc.org # (Required) IP used to bind the metrics endpoint (default 0.0.0.0)
128+
port: 9091 # (Optional, default 9091) port used to bind the service
129+
tls: # (Optional) the local path of TLS key (Could be the same as the sbi ones)
130+
pem: /home/sam/private-network/code/free5gc/cert/amf.pem # AMF TLS Certificate
131+
key: /home/sam/private-network/code/free5gc/cert/amf.key # AMF TLS Private key
132+
namespace: free5gc # (Optional, default free5gc)
133+
122134
logger: # log output setting
123135
enable: true # true or false
124136
level: info # how detailed to output, value: trace, debug, info, warn, error, fatal, panic

config/ausfcfg.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,18 @@ configuration:
2323
groupId: ausfGroup001 # ID for the group of the AUSF
2424
eapAkaSupiImsiPrefix: false # including "imsi-" prefix or not when using the SUPI to do EAP-AKA' authentication
2525

26+
# Metrics configuration
27+
# If using the same bindingIPv4 as the sbi server, make sure that the ports are different
28+
metrics:
29+
enable: false # (Optional, default false)
30+
scheme: http # (Required) the protocol for metrics (http or https, default https)
31+
bindingIPv4: ausf.free5gc.org # (Required) IP used to bind the metrics endpoint (default 0.0.0.0)
32+
port: 9091 # (Optional, default 9091) port used to bind the service
33+
tls: # (Optional) the local path of TLS key (Could be the same as the sbi ones)
34+
pem: /home/sam/private-network/code/free5gc/cert/ausf.pem # AUSF TLS Certificate
35+
key: /home/sam/private-network/code/free5gc/cert/ausf.key # AUSF TLS Private key
36+
namespace: free5gc # (Optional, default free5gc)
37+
2638
logger: # log output setting
2739
enable: true # true or false
2840
level: info # how detailed to output, value: trace, debug, info, warn, error, fatal, panic

config/chfcfg.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,19 @@ configuration:
4949
tls:
5050
pem: cert/chf.pem # CHF TLS Certificate
5151
key: cert/chf.key # CHF TLS Private key
52+
53+
# Metrics configuration
54+
# If using the same bindingIPv4 as the sbi server, make sure that the ports are different
55+
metrics:
56+
enable: false # (Optional, default false)
57+
scheme: http # (Required) the protocol for metrics (http or https, default https)
58+
bindingIPv4: chf.free5gc.org # (Required) IP used to bind the metrics endpoint (default 0.0.0.0)
59+
port: 9091 # (Optional, default 9091) port used to bind the service
60+
tls: # (Optional) the local path of TLS key (Could be the same as the sbi ones)
61+
pem: /home/sam/private-network/code/free5gc/cert/chf.pem # CHF TLS Certificate
62+
key: /home/sam/private-network/code/free5gc/cert/chf.key # CHF TLS Private key
63+
namespace: free5gc # (Optional, default free5gc)
64+
5265
logger: # log output setting
5366
enable: true # true or false
5467
level: info # how detailed to output, value: trace, debug, info, warn, error, fatal, panic

config/n3iwfcfg.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,18 @@ configuration:
5454
transFreq: 60s # frequency of transmission
5555
maxRetryTimes: 4 # the max number of DPD response of UE
5656

57+
# Metrics configuration
58+
# If using the same bindingIPv4 as the sbi server, make sure that the ports are different
59+
metrics:
60+
enable: false # (Optional, default false)
61+
scheme: http # (Required) the protocol for metrics (http or https, default https)
62+
bindingIPv4: n3iwf.free5gc.org # (Required) IP used to bind the metrics endpoint (default 0.0.0.0)
63+
port: 9091 # (Optional, default 9091) port used to bind the service
64+
tls: # (Optional) the local path of TLS key (Could be the same as the sbi ones)
65+
pem: /home/sam/private-network/code/free5gc/cert/n3iwf.pem # N3IWF TLS Certificate
66+
key: /home/sam/private-network/code/free5gc/cert/n3iwf.key # N3IWF TLS Private key
67+
namespace: free5gc # (Optional, default free5gc)
68+
5769
logger: # log output setting
5870
enable: true # true or false
5971
level: info # how detailed to output, value: trace, debug, info, warn, error, fatal, panic

config/nrfcfg.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,18 @@ configuration:
2424
- nnrf-nfm # Nnrf_NFManagement service
2525
- nnrf-disc # Nnrf_NFDiscovery service
2626

27+
# Metrics configuration
28+
# If using the same bindingIPv4 as the sbi server, make sure that the ports are different
29+
metrics:
30+
enable: false # (Optional, default false)
31+
scheme: http # (Required) the protocol for metrics (http or https, default https)
32+
bindingIPv4: nrf.free5gc.org # (Required) IP used to bind the metrics endpoint (default 0.0.0.0)
33+
port: 9091 # (Optional, default 9091) port used to bind the service
34+
tls: # (Optional) the local path of TLS key (Could be the same as the sbi ones)
35+
pem: /home/sam/private-network/code/free5gc/cert/nrf.pem # NRF TLS Certificate
36+
key: /home/sam/private-network/code/free5gc/cert/nrf.key # NRF TLS Private key
37+
namespace: free5gc # (Optional, default free5gc)
38+
2739
logger: # log output setting
2840
enable: true # true or false
2941
level: info # how detailed to output, value: trace, debug, info, warn, error, fatal, panic

config/nssfcfg.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,18 @@ configuration:
347347
sst: 1 # Slice/Service Type (uinteger, range: 0~255)
348348
sd: 000003 # Slice Differentiator (3 bytes hex string, range: 000000~FFFFFF)
349349

350+
# Metrics configuration
351+
# If using the same bindingIPv4 as the sbi server, make sure that the ports are different
352+
metrics:
353+
enable: false # (Optional, default false)
354+
scheme: http # (Required) the protocol for metrics (http or https, default https)
355+
bindingIPv4: nssf.free5gc.org # (Required) IP used to bind the metrics endpoint (default 0.0.0.0)
356+
port: 9091 # (Optional, default 9091) port used to bind the service
357+
tls: # (Optional) the local path of TLS key (Could be the same as the sbi ones)
358+
pem: /home/sam/private-network/code/free5gc/cert/nssf.pem # NSSF TLS Certificate
359+
key: /home/sam/private-network/code/free5gc/cert/nssf.key # NSSF TLS Private key
360+
namespace: free5gc # (Optional, default free5gc)
361+
350362
logger: # log output setting
351363
enable: true # true or false
352364
level: info # how detailed to output, value: trace, debug, info, warn, error, fatal, panic

config/pcfcfg.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,18 @@ configuration:
3030
url: mongodb://db:27017 # a valid URL of the mongodb
3131
locality: area1 # Name of the location where a set of AMF, SMF, PCF and UPFs are located
3232

33+
# Metrics configuration
34+
# If using the same bindingIPv4 as the sbi server, make sure that the ports are different
35+
metrics:
36+
enable: false # (Optional, default false)
37+
scheme: http # (Required) the protocol for metrics (http or https, default https)
38+
bindingIPv4: pcf.free5gc.org # (Required) IP used to bind the metrics endpoint (default 0.0.0.0)
39+
port: 9091 # (Optional, default 9091) port used to bind the service
40+
tls: # (Optional) the local path of TLS key (Could be the same as the sbi ones)
41+
pem: /home/sam/private-network/code/free5gc/cert/pcf.pem # PCF TLS Certificate
42+
key: /home/sam/private-network/code/free5gc/cert/pcf.key # PCF TLS Private key
43+
namespace: free5gc # (Optional, default free5gc)
44+
3345
logger: # log output setting
3446
enable: true # true or false
3547
level: info # how detailed to output, value: trace, debug, info, warn, error, fatal, panic

config/prometheus.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
global:
2+
scrape_interval: 15s
3+
evaluation_interval: 15s
4+
5+
scrape_configs:
6+
- job_name: "prometheus"
7+
static_configs:
8+
- targets: ["localhost:9090"]
9+
- targets: ["amf.free5gc.org:9091"]
10+
- targets: ["ausf.free5gc.org:9091"]
11+
- targets: ["chf.free5gc.org:9091"]
12+
- targets: ["n3iwf.free5gc.org:9091"]
13+
- targets: ["nrf.free5gc.org:9091"]
14+
- targets: ["nssf.free5gc.org:9091"]
15+
- targets: ["pcf.free5gc.org:9091"]
16+
- targets: ["smf.free5gc.org:9091"]
17+
- targets: ["tngf.free5gc.org:9091"]
18+
- targets: ["udm.free5gc.org:9091"]
19+
- targets: ["udr.free5gc.org:9091"]

config/smfcfg.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,19 @@ configuration:
9393
urrPeriod: 10 # default usage report period in seconds
9494
urrThreshold: 1000 # default usage report threshold in bytes
9595
requestedUnit: 1000
96+
97+
# Metrics configuration
98+
# If using the same bindingIPv4 as the sbi server, make sure that the ports are different
99+
metrics:
100+
enable: false # (Optional, default false)
101+
scheme: http # (Required) the protocol for metrics (http or https, default https)
102+
bindingIPv4: smf.free5gc.org # (Required) IP used to bind the metrics endpoint (default 0.0.0.0)
103+
port: 9091 # (Optional, default 9091) port used to bind the service
104+
tls: # (Optional) the local path of TLS key (Could be the same as the sbi ones)
105+
pem: /home/sam/private-network/code/free5gc/cert/smf.pem # SMF TLS Certificate
106+
key: /home/sam/private-network/code/free5gc/cert/smf.key # SMF TLS Private key
107+
namespace: free5gc # (Optional, default free5gc)
108+
96109
logger: # log output setting
97110
enable: true # true or false
98111
level: info # how detailed to output, value: trace, debug, info, warn, error, fatal, panic

0 commit comments

Comments
 (0)