-
Notifications
You must be signed in to change notification settings - Fork 13
Handle the case when vault metadata is not present #101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
pablin-10
wants to merge
18
commits into
main
Choose a base branch
from
fix_boot_in_gcp_without_vault
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
1b86700
feat: add observability tooling for flashbox images
MoeMahhouk b920e85
remove the extra metric endpoint
MoeMahhouk b0557e3
refinements and enable observability services
MoeMahhouk 0c9121c
fix gomplate build and prometheus permission issues
MoeMahhouk 2468d13
fix gomplate syntax issues
MoeMahhouk 8d00e76
extra refinement and fix binary naming
MoeMahhouk 5431bd6
remove unsupported cgroup option
MoeMahhouk 0187cad
fix container init process path in process-exporter config
MoeMahhouk 5ee980b
remove the podman regex to capture the container metrics correctly
MoeMahhouk 0681f8d
add network metrics to collect
MoeMahhouk 5961c8e
Fix error in fetch-config.sh
pablin-10 4d23a65
Merge pull request #100 from flashbots/pablo/fix-config-script
niccoloraspa f8b88e6
Handle the case when vault metadata is not present
pablin-10 62e91cc
Give empty defaults for firewall
pablin-10 da262d1
Add guards on firewall config to avoid crashes
pablin-10 7a4c8e4
Make dropbear soft-depend on firewall to avoid being locked out
pablin-10 397117b
Use bash in dynamic-config.sh also
pablin-10 4e92c3d
Remove trailing space
pablin-10 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| process_names: | ||
| # Monitor the searcher container (conmon + all children via --children flag) | ||
| - name: "searcher-container" | ||
| cmdline: | ||
| - 'conmon.*searcher-container' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| global: | ||
| scrape_interval: 15s | ||
| evaluation_interval: 15s | ||
|
|
||
| # Recording rules for aggregated metrics | ||
| rule_files: | ||
| - /etc/prometheus/recording_rules.yml | ||
|
|
||
| # Scrape configurations | ||
| scrape_configs: | ||
| # Node exporter on localhost | ||
| - job_name: 'node' | ||
| static_configs: | ||
| - targets: ['localhost:9100'] | ||
| metric_relabel_configs: | ||
| # Only keep aggregated metrics for remote write | ||
| - source_labels: [__name__] | ||
| regex: 'node_(cpu|memory|disk|filesystem|network)_.*' | ||
| action: keep | ||
|
|
||
| # Process exporter for container monitoring | ||
| - job_name: 'process' | ||
| static_configs: | ||
| - targets: ['localhost:9256'] | ||
|
|
||
| {{- $config := (datasource "config") }} | ||
| {{- if $config.remote_write_flashbots_url }} | ||
|
|
||
| # Remote write configuration (dynamically configured) | ||
| remote_write: | ||
| # Flashbots endpoint | ||
| - url: {{ $config.remote_write_flashbots_url }} | ||
| write_relabel_configs: | ||
| # Only send aggregated metrics | ||
| - source_labels: [__name__] | ||
| regex: 'flashbox:.*' | ||
| action: keep | ||
| {{- if $config.remote_write_flashbots_auth }} | ||
| basic_auth: | ||
| username: {{ $config.remote_write_flashbots_username }} | ||
| password: {{ $config.remote_write_flashbots_password }} | ||
| {{- end }} | ||
| {{- end }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| groups: | ||
| - name: flashbox_aggregated_metrics | ||
| interval: 30s # How often to evaluate rules | ||
| rules: | ||
| # CPU aggregated metrics | ||
| - record: flashbox:cpu_usage_percent | ||
| expr: 100 - (avg(rate(node_cpu_seconds_total{mode="idle"}[5m])) * 100) | ||
|
|
||
| - record: flashbox:cpu_usage_percent_by_mode | ||
| expr: avg(rate(node_cpu_seconds_total[5m])) by (mode) * 100 | ||
|
|
||
| # Memory aggregated metrics | ||
| - record: flashbox:memory_usage_percent | ||
| expr: (1 - (node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes)) * 100 | ||
|
|
||
| - record: flashbox:memory_available_gb | ||
| expr: node_memory_MemAvailable_bytes / 1024 / 1024 / 1024 | ||
|
|
||
| # Disk aggregated metrics - both root and persistent | ||
| # Root filesystem (always available) | ||
| - record: flashbox:disk_usage_percent_root | ||
| expr: 100 - (node_filesystem_avail_bytes{mountpoint="/"} / node_filesystem_size_bytes{mountpoint="/"} * 100) | ||
|
|
||
| # Persistent storage (available after mount) - returns no data if not mounted | ||
| - record: flashbox:disk_usage_percent_persistent | ||
| expr: 100 - (node_filesystem_avail_bytes{mountpoint="/persistent"} / node_filesystem_size_bytes{mountpoint="/persistent"} * 100) | ||
|
|
||
| - record: flashbox:disk_io_read_mb_per_sec | ||
| expr: rate(node_disk_read_bytes_total[5m]) / 1024 / 1024 | ||
|
|
||
| - record: flashbox:disk_io_write_mb_per_sec | ||
| expr: rate(node_disk_written_bytes_total[5m]) / 1024 / 1024 | ||
|
|
||
| # Container health metrics (using process exporter) | ||
| - record: flashbox:container_alive | ||
| expr: up{job="process"} * on(instance) group_left(cgroup) namedprocess_namegroup_num_procs{groupname=~".*searcher-container.*"} | ||
|
|
||
| - record: flashbox:container_cpu_percent | ||
| expr: rate(namedprocess_namegroup_cpu_seconds_total{groupname=~".*searcher-container.*"}[5m]) * 100 | ||
|
|
||
| - record: flashbox:container_memory_mb | ||
| expr: namedprocess_namegroup_memory_bytes{groupname=~".*searcher-container.*"} / 1024 / 1024 | ||
|
|
||
| # Network metrics (only counters, no detailed info) | ||
| - record: flashbox:network_receive_mb_total | ||
| expr: sum(node_network_receive_bytes_total) / 1024 / 1024 | ||
|
|
||
| - record: flashbox:network_transmit_mb_total | ||
| expr: sum(node_network_transmit_bytes_total) / 1024 / 1024 |
3 changes: 2 additions & 1 deletion
3
bob-common/mkosi.extra/etc/systemd/system/dropbear.service.d/dropbear-prereq.conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
56 changes: 56 additions & 0 deletions
56
bob-common/mkosi.extra/etc/systemd/system/node-exporter.service
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| [Unit] | ||
| Description=Prometheus Node Exporter | ||
| Documentation=https://github.com/prometheus/node_exporter | ||
| After=network-online.target | ||
| Wants=network-online.target | ||
|
|
||
| [Service] | ||
| Type=simple | ||
| User=prometheus | ||
| Group=prometheus | ||
| ExecStart=/usr/bin/prometheus-node-exporter \ | ||
| --web.listen-address=127.0.0.1:9100 \ | ||
| --collector.cpu \ | ||
| --collector.meminfo \ | ||
| --collector.diskstats \ | ||
| --collector.filesystem \ | ||
| --collector.netdev \ | ||
| --collector.loadavg \ | ||
| --no-collector.arp \ | ||
| --no-collector.bcache \ | ||
| --no-collector.bonding \ | ||
| --no-collector.conntrack \ | ||
| --no-collector.cpufreq \ | ||
| --no-collector.edac \ | ||
| --no-collector.entropy \ | ||
| --no-collector.filefd \ | ||
| --no-collector.hwmon \ | ||
| --no-collector.infiniband \ | ||
| --no-collector.ipvs \ | ||
| --no-collector.mdadm \ | ||
| --no-collector.netclass \ | ||
| --no-collector.netstat \ | ||
| --no-collector.nfs \ | ||
| --no-collector.nfsd \ | ||
| --no-collector.pressure \ | ||
| --no-collector.rapl \ | ||
| --no-collector.schedstat \ | ||
| --no-collector.sockstat \ | ||
| --no-collector.softnet \ | ||
| --no-collector.stat \ | ||
| --no-collector.textfile \ | ||
| --no-collector.thermal_zone \ | ||
| --no-collector.time \ | ||
| --no-collector.timex \ | ||
| --no-collector.udp_queues \ | ||
| --no-collector.uname \ | ||
| --no-collector.vmstat \ | ||
| --no-collector.xfs \ | ||
| --no-collector.zfs \ | ||
| --no-collector.systemd \ | ||
| --collector.filesystem.mount-points-exclude=^/(dev|proc|sys|run|var/lib/docker)($|/) | ||
| Restart=on-failure | ||
| RestartSec=5s | ||
|
|
||
| [Install] | ||
| WantedBy=multi-user.target |
19 changes: 19 additions & 0 deletions
19
bob-common/mkosi.extra/etc/systemd/system/process-exporter.service
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| [Unit] | ||
| Description=Prometheus Process Exporter | ||
| Documentation=https://github.com/ncabatoff/process-exporter | ||
| After=network-online.target searcher-container.service | ||
| Wants=network-online.target | ||
|
|
||
| [Service] | ||
| Type=simple | ||
| User=prometheus | ||
| Group=prometheus | ||
| ExecStart=/usr/bin/prometheus-process-exporter \ | ||
| --web.listen-address=127.0.0.1:9256 \ | ||
| --config.path=/etc/prometheus/process-exporter.yml \ | ||
| --children | ||
| Restart=on-failure | ||
| RestartSec=5s | ||
|
|
||
| [Install] | ||
| WantedBy=multi-user.target |
25 changes: 25 additions & 0 deletions
25
bob-common/mkosi.extra/etc/systemd/system/prometheus.service
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| [Unit] | ||
| Description=Prometheus Monitoring System | ||
| Documentation=https://prometheus.io/docs/introduction/overview/ | ||
| After=network-online.target fetch-config.service | ||
| Wants=network-online.target | ||
| Requires=fetch-config.service | ||
|
|
||
| [Service] | ||
| Type=simple | ||
| User=prometheus | ||
| Group=prometheus | ||
| ExecStartPre=+/usr/bin/gomplate -f /etc/prometheus/prometheus.yml.tmpl -o /etc/prometheus/prometheus.yml -d config=/etc/flashbox/observability-config.json | ||
| ExecStart=/usr/bin/prometheus \ | ||
| --config.file=/etc/prometheus/prometheus.yml \ | ||
| --storage.tsdb.path=/var/lib/prometheus/ \ | ||
| --storage.tsdb.retention.time=24h \ | ||
| --web.console.templates=/usr/share/prometheus/consoles \ | ||
| --web.console.libraries=/usr/share/prometheus/console_libraries \ | ||
| --web.listen-address=127.0.0.1:9090 | ||
| ExecReload=/bin/kill -HUP $MAINPID | ||
| Restart=on-failure | ||
| RestartSec=5s | ||
|
|
||
| [Install] | ||
| WantedBy=multi-user.target |
4 changes: 2 additions & 2 deletions
4
bob-common/mkosi.extra/etc/systemd/system/searcher-firewall.service
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain the rational behind this change? what is the scenario causing this to be locked out?
To my knowledge, this is the execution flow:
curlcommand to be set and allow the ssh command control panel to be ready for the searcher only.