Skip to content
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

feat: add telemetry support #136

Merged
merged 21 commits into from
May 11, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
051763e
feat(telemetry): add telemetry for CLI metrics
peterwht May 2, 2024
2978904
feat(telemetry): opt-in handler, better error handling and telemetry …
peterwht May 2, 2024
4d48e54
feat(telemetry): add reporting for errors
peterwht May 3, 2024
d8e2c9b
refactor(telemetry): reduce duplicated code, add comments, and genera…
peterwht May 3, 2024
a648e59
refactor(telemetry): refactor new parachain, and telemetry handling
peterwht May 4, 2024
f5a0837
fix(telemetry): fix error telemetry reporting
peterwht May 5, 2024
a6d6764
test(telemetry): unit tests for telemetry
peterwht May 6, 2024
c7c87c2
fix(telemetry): borrowing issue with multi-threads
peterwht May 6, 2024
10b72cf
merge main
peterwht May 6, 2024
449b890
refactor(telemetry): handle tel_data better
peterwht May 7, 2024
1412315
feat(telemetry): add no_telemetry feature flag to disable telemetry
peterwht May 7, 2024
7c1af47
chore: use edition.workspace in toml files
peterwht May 7, 2024
58826bd
chore: miscallaneous cleanups, documentation, and refactoring
peterwht May 7, 2024
6cca585
refactor(telemetry): change opt-in to opt-out
peterwht May 7, 2024
aa3e3ea
chore: cleanup whitespace and comments
peterwht May 7, 2024
c802275
refactor: improve feature (#145)
evilrobot-01 May 8, 2024
04d6e26
Merge branch 'main' into peter/feat-metrics
brunopgalvao May 10, 2024
482e76a
chore(telemetry): update endpoint and website-id
peterwht May 10, 2024
b437503
refactor(telemetry): default values in `Telemetry::new` with helper `…
peterwht May 10, 2024
f0979d6
chore(telemetry): resolve regressions
peterwht May 10, 2024
e14253a
chore: merge main and adapt pop install command
AlexD10S May 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@
**/node_modules/
/src/x.rs

.DS_Store
.DS_Store

# IDEs
.idea
.vscode
109 changes: 108 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 9 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,18 @@ members = ["crates/*"]

[workspace.dependencies]
anyhow = "1.0"
thiserror = "1.0.58"
dirs = { version = "5.0" }
peterwht marked this conversation as resolved.
Show resolved Hide resolved
env_logger = "0.11.1"
duct = "0.13"
git2 = "0.18"
hostname = "0.4.0"
peterwht marked this conversation as resolved.
Show resolved Hide resolved
log = "0.4.20"
mockito = "1.4.0"
tempfile = "3.8"
thiserror = "1.0.58"

# networking
reqwest = { version = "0.11", features = ["json"] }
tokio = { version = "1.0", features = ["macros", "rt-multi-thread"] }
url = { version = "2.5" }

Expand All @@ -37,7 +45,6 @@ walkdir = "2.4"
indexmap = { version = "2.2" }
toml_edit = { version = "0.22", features = ["serde"] }
symlink = { version = "0.1" }
reqwest = { version = "0.11" }
serde_json = { version = "1.0" }
serde = { version = "1.0", features = ["derive"] }
zombienet-sdk = { git = "https://github.com/r0gue-io/zombienet-sdk", branch = "pop", version = "0.1.0-alpha.1" }
Expand Down
10 changes: 8 additions & 2 deletions crates/pop-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@ path = "src/main.rs"
[dependencies]
anyhow.workspace = true
duct.workspace = true
env_logger.workspace = true
serde.workspace = true
peterwht marked this conversation as resolved.
Show resolved Hide resolved
serde_json.workspace = true
tempfile.workspace = true
url.workspace = true
tokio.workspace = true
url.workspace = true

# pop-cli
clap.workspace = true
Expand All @@ -29,9 +32,12 @@ sp-weights = { workspace = true, optional = true }

# parachains
pop-parachains = { path = "../pop-parachains", optional = true }
dirs = { version = "5.0", optional = true }
dirs = { workspace = true, optional = true }
git2.workspace = true

# telemetry
pop-telemetry = { path = "../pop-telemetry" }

[dev-dependencies]
assert_cmd = "2.0.14"
predicates = "3.1.0"
Expand Down
1 change: 1 addition & 0 deletions crates/pop-cli/src/commands/build/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ impl BuildContractCommand {
pub(crate) fn execute(&self) -> anyhow::Result<()> {
clear_screen()?;
intro(format!("{}: Building a contract", style(" Pop CLI ").black().on_magenta()))?;

peterwht marked this conversation as resolved.
Show resolved Hide resolved
set_theme(Theme);

let result_build = build_smart_contract(&self.path)?;
Expand Down
1 change: 1 addition & 0 deletions crates/pop-cli/src/commands/build/parachain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ impl BuildParachainCommand {
pub(crate) fn execute(&self) -> anyhow::Result<()> {
clear_screen()?;
intro(format!("{}: Building a parachain", style(" Pop CLI ").black().on_magenta()))?;

set_theme(Theme);
build_parachain(&self.path)?;

Expand Down
1 change: 1 addition & 0 deletions crates/pop-cli/src/commands/call/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ impl CallContractCommand {
pub(crate) async fn execute(&self) -> anyhow::Result<()> {
clear_screen()?;
intro(format!("{}: Calling a contract", style(" Pop CLI ").black().on_magenta()))?;

set_theme(Theme);

let call_exec = set_up_call(CallOpts {
Expand Down
1 change: 1 addition & 0 deletions crates/pop-cli/src/commands/new/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ impl NewContractCommand {
let spinner = cliclack::spinner();
spinner.start("Generating contract...");
create_smart_contract(&self.name, contract_path.as_path())?;

spinner.stop("Smart contract created!");
outro(format!("cd into \"{}\" and enjoy hacking! 🚀", contract_path.display()))?;
Ok(())
Expand Down
1 change: 1 addition & 0 deletions crates/pop-cli/src/commands/new/pallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ impl NewPalletCommand {
description: self.description.clone().expect("default values"),
},
)?;

spinner.stop("Generation complete");
outro(format!("cd into \"{}\" and enjoy hacking! 🚀", &self.name))?;
Ok(())
Expand Down
Loading
Loading