Skip to content

Commit

Permalink
Release 23.05
Browse files Browse the repository at this point in the history
  • Loading branch information
braiins committed May 16, 2023
1 parent fd4bfab commit 45ce941
Show file tree
Hide file tree
Showing 28 changed files with 3,902 additions and 908 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ stock_fw_scrape_timeout = "5s"
# maximal number of parallel scrape requests for stock FW devices
stock_fw_scrape_max_concurrency = 40000
```
### Braiins Farm Monitor Configutation
### Braiins Farm Proxy Configutation
Since Braiins Farm Proxy version 23.01, telemetry data are collected in order to be able to track technical issues, errors and future improvements of the application. In case the user doesn't want to send telemetry data to Braiins, he can opt out. Just add to the proxy configuration file following rows:

```
Expand Down
2 changes: 0 additions & 2 deletions config/sample.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ name = "S1"
port = 3336
# Bonus related to devfee
#slushpool_bos_bonus = "bosBonusUserName"
# BOS referral code
#bos_referral_code = "referralCode"

[[target]]
# Name of this target
Expand Down
31 changes: 6 additions & 25 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ volumes:
scanner_data: {}
services:
farm-proxy:
image: braiinssystems/farm-proxy:23.01 # Will be replaced with braiinssystems/farm-proxy:TAG upon public release
image: braiinssystems/farm-proxy:23.05 # Will be replaced with braiinssystems/farm-proxy:TAG upon public release
container_name: farm-proxy
network_mode: "host"
volumes:
Expand All @@ -21,6 +21,10 @@ services:
max-size: "100m"
max-file: "50"
compress: "true"
ulimits:
nofile:
hard: "1048576"
soft: "262144"
# metrics-exporter is a program, which performs device discovery on the defined network and pulls data from miners running a Stock FW. As a result, those data can be digested by Prometheus and visualized in Grafana dashboard, see dashboard "Farm Dashboard"
metrics-exporter:
image: braiinssystems/farm-monitor:23.01
Expand Down Expand Up @@ -57,31 +61,8 @@ services:
compress: "true"
labels:
org.label-schema.group: "monitoring"
# nodeexporter is a container designed to monitor the host system, more info in https://github.com/prometheus/node_exporter
# nodeexporter:
# image: prom/node-exporter:latest
# container_name: nodeexporter
# network_mode: "host"
# volumes:
# - /proc:/host/proc:ro
# - /sys:/host/sys:ro
# - /:/rootfs:ro
# command:
# - '--path.procfs=/host/proc'
# - '--path.rootfs=/rootfs'
# - '--path.sysfs=/host/sys'
# - '--collector.filesystem.ignored-mount-points=^/(sys|proc|dev|host|etc)($$|/)'
# restart: unless-stopped
# logging:
# driver: "json-file"
# options:
# max-size: "10m"
# max-file: "5"
# compress: "true"
# labels:
# org.label-schema.group: "monitoring"
grafana:
image: grafana/grafana:8.4.0
image: grafana/grafana:9.5.1
container_name: grafana
network_mode: "host"
depends_on:
Expand Down
274 changes: 274 additions & 0 deletions monitoring/grafana/provisioning/alerting/alerts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,274 @@
apiVersion: 1
groups:
- orgId: 1
name: invalid-license
folder: Alerts
interval: 1m
rules:
- uid: LTLa_oaVz
title: Invalid Braiins OS+ Licences
condition: Condition
data:
- refId: A
relativeTimeRange:
from: 86400
to: 0
datasourceUid: PABF2E7BD7AE7B0F4
model:
editorMode: code
exemplar: false
expr: count(license_state{job="braiinsos-data"} > 1) > 0
hide: false
instant: false
intervalMs: 1000
legendFormat: __auto
maxDataPoints: 43200
range: true
refId: A
- refId: Number of affected miners
relativeTimeRange:
from: 86400
to: 0
datasourceUid: __expr__
model:
conditions:
- evaluator:
params: []
type: gt
operator:
type: and
query:
params:
- B
reducer:
params: []
type: last
type: query
datasource:
type: __expr__
uid: __expr__
expression: A
hide: false
intervalMs: 1000
maxDataPoints: 43200
reducer: last
refId: Number of affected miners
type: reduce
- refId: Condition
relativeTimeRange:
from: 86400
to: 0
datasourceUid: __expr__
model:
conditions:
- evaluator:
params:
- 0
type: gt
operator:
type: and
query:
params:
- C
reducer:
params: []
type: last
type: query
datasource:
type: __expr__
uid: __expr__
expression: Number of affected miners
hide: false
intervalMs: 1000
maxDataPoints: 43200
refId: Condition
type: threshold
dashboardUid: syQG2Ha4z
panelId: 2
noDataState: OK
execErrState: Error
for: 5m
annotations:
__dashboardUid__: syQG2Ha4z
__panelId__: "2"
description: Invalid Licenses
summary: Invalid Licenses
labels:
severity: critical
type: license
isPaused: false
- uid: AhDpvAa4z
title: No Braiins OS+ Licences
condition: Condition
data:
- refId: A
relativeTimeRange:
from: 600
to: 0
datasourceUid: PABF2E7BD7AE7B0F4
model:
editorMode: code
expr: count(license_state{job="braiinsos-data"} == 0 and license_time_to_restricted_seconds < 55 * 60) > 0
hide: false
intervalMs: 1000
legendFormat: __auto
maxDataPoints: 43200
range: true
refId: A
- refId: Number of affected miners
relativeTimeRange:
from: 600
to: 0
datasourceUid: __expr__
model:
conditions:
- evaluator:
params: []
type: gt
operator:
type: and
query:
params:
- B
reducer:
params: []
type: last
type: query
datasource:
type: __expr__
uid: __expr__
expression: A
hide: false
intervalMs: 1000
maxDataPoints: 43200
reducer: last
refId: Number of affected miners
type: reduce
- refId: Condition
relativeTimeRange:
from: 600
to: 0
datasourceUid: __expr__
model:
conditions:
- evaluator:
params:
- 0
type: gt
operator:
type: and
query:
params:
- C
reducer:
params: []
type: last
type: query
datasource:
type: __expr__
uid: __expr__
expression: Number of affected miners
hide: false
intervalMs: 1000
maxDataPoints: 43200
refId: Condition
type: threshold
dashboardUid: Kzx8BHa4k
panelId: 2
noDataState: OK
execErrState: Error
for: 5m
annotations:
__dashboardUid__: Kzx8BHa4k
__panelId__: "2"
description: No Braiins OS+ License
summary: No Braiins OS+ License
labels:
severity: warning
type: license
isPaused: false
- uid: GnxL0AaVz
title: Soon Expired Braiins OS+ Licences
condition: Condition
data:
- refId: A
relativeTimeRange:
from: 600
to: 0
datasourceUid: PABF2E7BD7AE7B0F4
model:
editorMode: code
expr: count(license_state{job="braiinsos-data",label=~"$label"} == 1 and license_time_to_restricted_seconds < 150 * 60) > 0
hide: false
intervalMs: 1000
legendFormat: __auto
maxDataPoints: 43200
range: true
refId: A
- refId: Number of affected miners
relativeTimeRange:
from: 600
to: 0
datasourceUid: __expr__
model:
conditions:
- evaluator:
params: []
type: gt
operator:
type: and
query:
params:
- B
reducer:
params: []
type: last
type: query
datasource:
type: __expr__
uid: __expr__
expression: A
hide: false
intervalMs: 1000
maxDataPoints: 43200
reducer: last
refId: Number of affected miners
type: reduce
- refId: Condition
relativeTimeRange:
from: 600
to: 0
datasourceUid: __expr__
model:
conditions:
- evaluator:
params:
- 0
type: gt
operator:
type: and
query:
params:
- C
reducer:
params: []
type: last
type: query
datasource:
type: __expr__
uid: __expr__
expression: Number of affected miners
hide: false
intervalMs: 1000
maxDataPoints: 43200
refId: Condition
type: threshold
noDataState: OK
execErrState: Alerting
for: 5m
annotations:
summary: Soon Expired Braiins OS+ Licences
labels:
severity: warning
type: license
isPaused: false
21 changes: 21 additions & 0 deletions monitoring/grafana/provisioning/alerting/contact-points.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: 1
# more info here https://grafana.com/docs/grafana/latest/alerting/set-up/provision-alerting-resources/file-provisioning/
contactPoints:
- orgId: 1
# in the file ./monitoring/grafana/provisioning/grafana.ini you need to define your [smtp] to be able to get email alerts
name: Email
receivers:
- uid: HNEU8Ta4zz
type: email
settings:
addresses: your_name@your_domain.cz
singleEmail: false
disableResolveMessage: true
# to be able to use Telegram, it is needed to generate BOT token. Here you can read how to do it https://medium.com/geekculture/generate-telegram-token-for-bot-api-d26faf9bf064
- uid: mOVzlTaVk
type: telegram
settings:
bottoken: "token" #Telegram bottoken in ""
chatid: "chat_id" #Telegram bottoken in ""
disable_notification: false
disableResolveMessage: true
17 changes: 17 additions & 0 deletions monitoring/grafana/provisioning/alerting/mute-timings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: 1

# A mute timing is a recurring interval of time when no new notifications for a policy are generated or sent.
# Use them to prevent alerts from firing a specific and reoccurring period, for example, a regular maintenance period.
# Read more at https://grafana.com/docs/grafana/latest/alerting/manage-notifications/mute-timings/

# To allow mute timings, uncomment time_intervals section with prepared simple config. User can modify it to meet his needs.
# Read more about time interval at at https://prometheus.io/docs/alerting/latest/configuration/#time_interval-0
muteTimes:
- orgId: 1
name: mti_1
#time_intervals:
# - times:
# - start_time: '09:00'
# end_time: '17:00'
# weekdays: ['monday:friday']

11 changes: 11 additions & 0 deletions monitoring/grafana/provisioning/alerting/policy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: 1

policies:
- orgId: 1
receiver: Email
group_by: ['grafana_folder','alertname']
object_matchers:
- ['type', '=', 'license']
group_wait: 1m
group_interval: 5m
repeat_interval: 1h
Loading

0 comments on commit 45ce941

Please sign in to comment.