-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
blockscout-service-launcher: Add features for each module (#529)
* Split launcher crate on 'database', 'launcher', and 'tracing' features * Bump 'tonic' to 0.9, 'opentelemetry' to 0.19, 'opentelemetry-jaeger' to 0.18, 'tracing-opentelemetry' to 0.19 * Sort dependencies * Bump to 0.8.0
- Loading branch information
1 parent
45989be
commit dca3405
Showing
10 changed files
with
120 additions
and
76 deletions.
There are no files selected for viewing
This file contains 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
2 changes: 1 addition & 1 deletion
2
...blockscout-service-launcher/src/launch.rs → ...t-service-launcher/src/launcher/launch.rs
This file contains 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.
This file contains 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,8 @@ | ||
mod launch; | ||
mod metrics; | ||
mod router; | ||
mod settings; | ||
|
||
pub use launch::{launch, LaunchSettings}; | ||
pub use router::HttpRouter; | ||
pub use settings::*; |
File renamed without changes.
This file contains 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 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 |
---|---|---|
@@ -1,13 +1,8 @@ | ||
mod launch; | ||
mod metrics; | ||
mod router; | ||
mod settings; | ||
mod tracing; | ||
|
||
pub use crate::tracing::init_logs; | ||
pub use launch::{launch, LaunchSettings}; | ||
pub use router::HttpRouter; | ||
pub use settings::*; | ||
|
||
#[cfg(feature = "database")] | ||
pub mod database; | ||
|
||
#[cfg(feature = "launcher")] | ||
pub mod launcher; | ||
|
||
#[cfg(feature = "tracing")] | ||
pub mod tracing; |
2 changes: 1 addition & 1 deletion
2
...lockscout-service-launcher/src/tracing.rs → ...cout-service-launcher/src/tracing/init.rs
This file contains 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 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 @@ | ||
mod init; | ||
mod settings; | ||
|
||
pub use init::*; | ||
pub use settings::*; |
This file contains 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,42 @@ | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] | ||
#[serde(rename_all = "snake_case")] | ||
pub enum TracingFormat { | ||
Default, | ||
Json, | ||
} | ||
|
||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] | ||
#[serde(default, deny_unknown_fields)] | ||
pub struct TracingSettings { | ||
/// If disabled, tracing is not initialized for neither | ||
/// stdout, nor jaeger (enabled by default). | ||
pub enabled: bool, | ||
pub format: TracingFormat, | ||
} | ||
|
||
impl Default for TracingSettings { | ||
fn default() -> Self { | ||
Self { | ||
enabled: true, | ||
format: TracingFormat::Default, | ||
} | ||
} | ||
} | ||
|
||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] | ||
#[serde(default, deny_unknown_fields)] | ||
pub struct JaegerSettings { | ||
pub enabled: bool, | ||
pub agent_endpoint: String, | ||
} | ||
|
||
impl Default for JaegerSettings { | ||
fn default() -> Self { | ||
Self { | ||
enabled: false, | ||
agent_endpoint: "127.0.0.1:6831".to_string(), | ||
} | ||
} | ||
} |