Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit d9ec6ec

Browse files
grtlrAlex6323
andauthored
feat!: remove loki (#1009)
Co-authored-by: /alex/ <[email protected]>
1 parent 77e3537 commit d9ec6ec

File tree

10 files changed

+18
-618
lines changed

10 files changed

+18
-618
lines changed

Cargo.lock

Lines changed: 16 additions & 299 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,6 @@ zeroize = { version = "1.5", default-features = false, features = [ "std" ], opt
7575
inx = { version = "1.0.0-beta", default-features = false, optional = true }
7676
tonic = { version = "0.8", default-features = false, optional = true }
7777

78-
# Loki
79-
tracing-loki = { version = "0.2", default-features = false, features = [ "compat-0-2-1", "native-tls" ], optional = true }
80-
8178
# PoI
8279
iota-crypto = { version = "0.15", default-features = false, features = [ "blake2b" ], optional = true }
8380

@@ -90,7 +87,6 @@ default = [
9087
"analytics",
9188
"api",
9289
"inx",
93-
"loki",
9490
"metrics",
9591
"poi",
9692
]
@@ -117,9 +113,6 @@ inx = [
117113
"dep:inx",
118114
"dep:tonic",
119115
]
120-
loki = [
121-
"dep:tracing-loki",
122-
]
123116
metrics = [
124117
"dep:influxdb",
125118
"dep:chrono",

docker/assets/grafana/dashboards/log_dashboard.json

Lines changed: 0 additions & 156 deletions
This file was deleted.

docker/assets/grafana/datasources/loki_ds.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

docker/assets/loki/config.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.

docker/assets/promtail/config.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

docker/docker-compose.yml

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ services:
4040
- "--inx-url=http://hornet:9029"
4141
- "--jwt-password=${JWT_PASSWORD}"
4242
- "--jwt-salt=${JWT_SALT}"
43-
- "--loki-url=http://loki:3100"
4443

4544
influx:
4645
image: influxdb:1.8
@@ -164,25 +163,3 @@ services:
164163
- ./assets/grafana/:/etc/grafana/provisioning/
165164
environment:
166165
- GF_INSTALL_PLUGINS=yesoreyeram-infinity-datasource
167-
168-
loki:
169-
image: grafana/loki:latest
170-
profiles:
171-
- metrics
172-
container_name: loki
173-
restart: unless-stopped
174-
ports:
175-
- 3100:3100
176-
volumes:
177-
- ./assets/loki/:/etc/loki/
178-
command: -config.file=/etc/loki/config.yml
179-
180-
promtail:
181-
image: grafana/promtail:latest
182-
profiles:
183-
- metrics
184-
container_name: promtail
185-
volumes:
186-
- ./assets/promtail/:/etc/promtail/
187-
- ./data/promtail/log:/var/log
188-
command: -config.file=/etc/promtail/config.yml

src/bin/inx-chronicle/cli.rs

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@ pub struct ClArgs {
2626
#[cfg(feature = "api")]
2727
#[command(flatten, next_help_heading = "API")]
2828
pub api: ApiArgs,
29-
/// Loki arguments.
30-
#[cfg(feature = "loki")]
31-
#[command(flatten, next_help_heading = "Loki")]
32-
pub loki: LokiArgs,
3329
/// Subcommands.
3430
#[command(subcommand)]
3531
pub subcommand: Option<Subcommands>,
@@ -220,27 +216,6 @@ pub struct JwtArgs {
220216
pub jwt_expiration: std::time::Duration,
221217
}
222218

223-
#[cfg(feature = "loki")]
224-
#[derive(Args, Debug)]
225-
pub struct LokiArgs {
226-
/// The url pointing to a Grafana Loki instance.
227-
#[arg(long, value_name = "URL", default_value = crate::config::loki::DEFAULT_LOKI_URL)]
228-
pub loki_url: String,
229-
/// Disable Grafana Loki log writes.
230-
#[arg(long, default_value_t = !crate::config::loki::DEFAULT_LOKI_ENABLED)]
231-
pub disable_loki: bool,
232-
}
233-
234-
#[cfg(feature = "loki")]
235-
impl From<&LokiArgs> for crate::config::loki::LokiConfig {
236-
fn from(value: &LokiArgs) -> Self {
237-
Self {
238-
enabled: !value.disable_loki,
239-
url: value.loki_url.clone(),
240-
}
241-
}
242-
}
243-
244219
#[cfg(any(feature = "inx", feature = "api"))]
245220
fn parse_duration(arg: &str) -> Result<std::time::Duration, humantime::DurationError> {
246221
arg.parse::<humantime::Duration>().map(Into::into)
@@ -257,8 +232,6 @@ impl ClArgs {
257232
inx: (&self.inx).into(),
258233
#[cfg(feature = "api")]
259234
api: (&self.api).into(),
260-
#[cfg(feature = "loki")]
261-
loki: (&self.loki).into(),
262235
}
263236
}
264237

src/bin/inx-chronicle/config.rs

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -15,30 +15,4 @@ pub struct ChronicleConfig {
1515
pub api: crate::api::ApiConfig,
1616
#[cfg(feature = "inx")]
1717
pub inx: super::stardust_inx::InxConfig,
18-
#[cfg(feature = "loki")]
19-
pub loki: loki::LokiConfig,
20-
}
21-
22-
#[cfg(feature = "loki")]
23-
pub mod loki {
24-
use super::*;
25-
26-
pub const DEFAULT_LOKI_ENABLED: bool = true;
27-
pub const DEFAULT_LOKI_URL: &str = "http://localhost:3100";
28-
29-
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
30-
#[serde(default)]
31-
pub struct LokiConfig {
32-
pub enabled: bool,
33-
pub url: String,
34-
}
35-
36-
impl Default for LokiConfig {
37-
fn default() -> Self {
38-
Self {
39-
enabled: DEFAULT_LOKI_ENABLED,
40-
url: DEFAULT_LOKI_URL.to_string(),
41-
}
42-
}
43-
}
4418
}

0 commit comments

Comments
 (0)