Skip to content

Commit

Permalink
fix: linters
Browse files Browse the repository at this point in the history
  • Loading branch information
EvolveArt committed Dec 15, 2023
1 parent ffa51c1 commit 3ba0513
Show file tree
Hide file tree
Showing 11 changed files with 48 additions and 52 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linters-cargo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ jobs:
run: |
cargo fmt -- --check
cargo clippy --no-deps -- -D warnings
cargo clippy --tests --no-deps -- -D warnings
cargo clippy --tests --no-deps -- -D warnings
2 changes: 1 addition & 1 deletion .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ jobs:
- name: Checkout toml files
uses: actions/checkout@v3
- name: Run toml check
run: npx @taplo/cli fmt --config ./taplo/taplo.toml --check
run: npx @taplo/cli fmt --config ./taplo/taplo.toml --check
2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ jobs:
linters_cargo:
name: Run Cargo linters
uses: ./.github/workflows/linters-cargo.yml
needs: rust_build
needs: rust_build
2 changes: 1 addition & 1 deletion .github/workflows/rust-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ jobs:

- name: Build the project
run: |
cargo build --release --workspace
cargo build --release --workspace
7 changes: 2 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
{
"rust-analyzer.linkedProjects": [
"Cargo.toml",
"./Cargo.toml"
]
}
"rust-analyzer.linkedProjects": ["Cargo.toml", "./Cargo.toml"]
}
30 changes: 15 additions & 15 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ edition = "2021"
[dependencies]
axum = { version = "0.6", features = ["macros", "multipart"] }
axum-macros = "0.3"
chrono = "0.4"
bigdecimal = "0.4.1"
num-bigint = "0.4"
chrono = "0.4"
coingecko = "1.0.1"
deadpool = { version = "0.9.3", features = ["managed"] }
diesel = { version = "2.1.0", features = [
"postgres",
"numeric",
Expand All @@ -24,21 +25,20 @@ diesel-async = { version = "0.4.1", features = [
"postgres",
"tokio",
] }
dotenv = "0.15.0"
diesel_derives = "1.4.0"
diesel_migrations = "2"
uuid = { version = "1.4", features = ["fast-rng", "v4", "serde"] }
tokio = { version = "1", features = ["full"] }
starknet_api = "0.4.1"
starknet = "0.8.0"
deadpool = { version = "0.9.3", features = ["managed"] }
dotenv = "0.15.0"
env_logger = "0.10.1"
futures = "0.3.28"
prometheus = "0.13.3"
lazy_static = "1.4.0"
hyper = "0.14.27"
url = "2.5.0"
strum = { version = "0.25.0", features = ["derive"] }
coingecko = "1.0.1"
phf = { version = "0.11", features = ["macros"] }
lazy_static = "1.4.0"
log = "0.4.20"
env_logger = "0.10.1"
num-bigint = "0.4"
phf = { version = "0.11", features = ["macros"] }
prometheus = "0.13.3"
starknet = "0.8.0"
starknet_api = "0.4.1"
strum = { version = "0.25.0", features = ["derive"] }
tokio = { version = "1", features = ["full"] }
url = "2.5.0"
uuid = { version = "1.4", features = ["fast-rng", "v4", "serde"] }
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@
This service runs a prometheus server that returns metrics on the `/metrics` route.

It powers our internal grafana dashboards and alerts.

22 changes: 11 additions & 11 deletions prometheus/alertmanager.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
global:
smtp_smarthost: '${SMTP_HOST}'
smtp_from: '${SMTP_FROM}'
smtp_auth_username: '${SMTP_AUTH_USERNAME}'
smtp_auth_password: '${SMTP_AUTH_PASSWORD}'
smtp_require_tls: true
smtp_smarthost: "${SMTP_HOST}"
smtp_from: "${SMTP_FROM}"
smtp_auth_username: "${SMTP_AUTH_USERNAME}"
smtp_auth_password: "${SMTP_AUTH_PASSWORD}"
smtp_require_tls: true

route:
group_by: ['instance', 'severity']
group_by: ["instance", "severity"]
group_wait: 30s
group_interval: 5m
repeat_interval: 4h
receiver: 'email_configs'
receiver: "email_configs"
receivers:
- name: 'email_configs'
email_configs:
- to: '${EMAIL_TO}'
send_resolved: true
- name: "email_configs"
email_configs:
- to: "${EMAIL_TO}"
send_resolved: true
20 changes: 10 additions & 10 deletions prometheus/alerts.rules.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
groups:
- name: example
rules:
- alert: TimeSinceLastUpdateTooHigh
expr: time_since_last_update_seconds > 1200
for: 5m
labels:
severity: critical
annotations:
summary: "Time since the last update is too high"
description: "The time since the last update of {{ $labels.pair }} from {{ $labels.source }} has exceeded 1200 seconds."
- name: example
rules:
- alert: TimeSinceLastUpdateTooHigh
expr: time_since_last_update_seconds > 1200
for: 5m
labels:
severity: critical
annotations:
summary: "Time since the last update is too high"
description: "The time since the last update of {{ $labels.pair }} from {{ $labels.source }} has exceeded 1200 seconds."
10 changes: 5 additions & 5 deletions prometheus/prometheus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ global:
evaluation_interval: 15s

scrape_configs:
- job_name: 'prometheus_monitoring'
- job_name: "prometheus_monitoring"
static_configs:
- targets: ['127.0.0.1:8080']
- targets: ["127.0.0.1:8080"]
rule_files:
- "alerts.rules.yml"
alerting:
alertmanagers:
- static_configs:
- targets:
- localhost:9093
- static_configs:
- targets:
- localhost:9093
2 changes: 1 addition & 1 deletion taplo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ readable formatting.

Taplo allows you to customize the formatting rules by adding configuration
options. You can find the available options and how to use them
[here](https://taplo.tamasfe.dev/configuration/formatter-options.html).
[here](https://taplo.tamasfe.dev/configuration/formatter-options.html).

0 comments on commit 3ba0513

Please sign in to comment.