-
Notifications
You must be signed in to change notification settings - Fork 40
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
[clickhouse] Clickana monitoring dashboard tool #7207
Open
karencfv
wants to merge
39
commits into
oxidecomputer:main
Choose a base branch
from
karencfv:clickana
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 35 commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
a986ca6
poc
karencfv 0c2e4ee
notes
karencfv db1e6c6
clean up
karencfv 51baaa4
simplify
karencfv 707021d
move file to devtools
karencfv 1e07b65
Create dashboard data struct
karencfv 0e83157
use full UTC date/time as label
karencfv 98b9b32
clean up
karencfv 99b5f78
adjust upper and lower Y axis bounds and labels
karencfv 13d4436
Some more clean up
karencfv e147c5a
retrieve settings from CLI
karencfv 77fc165
Make room to add more charts
karencfv bcc51cc
Set up to generate charts from several metrics
karencfv a44c7b6
clean up
karencfv e552d71
Restructure and add support for other charts
karencfv 06d9e61
Restructure and add support for other charts
karencfv af16dd9
strat breaking up functions
karencfv 7957e0c
better label calculation
karencfv 1d0d5fe
extract calculations into functions
karencfv 8c1bd2a
No need to use u64
karencfv 7ada5ae
Clean up value handling
karencfv 1d4ec78
Clean up timestamp handling
karencfv 317b95c
fmt
karencfv 54b86f5
restructure methods as standalone functions
karencfv 7896ed8
restructure bounds and labels
karencfv dee3179
separate chart into another file
karencfv 17fc96d
Add other charts
karencfv ae5819c
Add dashboard title
karencfv 7822a8a
show time range in title bar
karencfv ed8651f
fix mid value label for y axis
karencfv 1d7521c
clean up
karencfv 2c53dbf
make API calls concurrent
karencfv e41c0be
simplify run method
karencfv a0cc34f
clean up
karencfv a176a5f
include in clickhouse and clickhouse-server zones
karencfv 7b6cd44
add some tests
karencfv a525cbe
clean up
karencfv c8d22cd
More tests
karencfv 21b793c
fmt
karencfv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,31 @@ | ||
[package] | ||
name = "clickana" | ||
version = "0.1.0" | ||
edition = "2021" | ||
license = "MPL-2.0" | ||
|
||
[dependencies] | ||
anyhow.workspace = true | ||
camino.workspace = true | ||
chrono.workspace = true | ||
clap.workspace = true | ||
clickhouse-admin-types.workspace = true | ||
clickhouse-admin-server-client.workspace = true | ||
dropshot.workspace = true | ||
futures.workspace = true | ||
omicron-common.workspace = true | ||
ratatui.workspace = true | ||
schemars.workspace = true | ||
slog.workspace = true | ||
slog-async.workspace = true | ||
slog-dtrace.workspace = true | ||
slog-error-chain.workspace = true | ||
slog-term.workspace = true | ||
serde_json.workspace = true | ||
tokio.workspace = true | ||
tokio-postgres.workspace = true | ||
|
||
omicron-workspace-hack.workspace = true | ||
|
||
[lints] | ||
workspace = true |
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,57 @@ | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this | ||
// file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
|
||
use anyhow::Result; | ||
use camino::Utf8PathBuf; | ||
use clap::Parser; | ||
use clickana::Clickana; | ||
use std::net::SocketAddr; | ||
|
||
const CLICKANA_LOG_FILE: &str = "/tmp/clickana.log"; | ||
|
||
#[tokio::main] | ||
async fn main() -> Result<()> { | ||
let args = Cli::parse(); | ||
|
||
let terminal = ratatui::init(); | ||
let result = Clickana::new( | ||
args.clickhouse_addr, | ||
args.log_path, | ||
args.sampling_interval, | ||
args.time_range, | ||
args.refresh_interval, | ||
) | ||
.run(terminal) | ||
.await; | ||
ratatui::restore(); | ||
result | ||
} | ||
|
||
#[derive(Debug, Parser)] | ||
struct Cli { | ||
/// Path to the log file | ||
#[arg( | ||
long, | ||
short, | ||
env = "CLICKANA_LOG_PATH", | ||
default_value = CLICKANA_LOG_FILE, | ||
)] | ||
log_path: Utf8PathBuf, | ||
|
||
/// Address where a clickhouse admin server is listening on | ||
#[arg(long, short = 'a')] | ||
clickhouse_addr: SocketAddr, | ||
|
||
/// The interval to collect monitoring data in seconds | ||
#[arg(long, short, default_value_t = 60)] | ||
sampling_interval: u64, | ||
|
||
/// Range of time to collect monitoring data in seconds | ||
#[arg(long, short, default_value_t = 3600)] | ||
time_range: u64, | ||
|
||
/// The interval at which the dashboards will refresh | ||
#[arg(long, short, default_value_t = 60)] | ||
refresh_interval: u64, | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is seriously doing my head in. Since Timestamp is an untagged enum, serde is having a hard time deserializing. My custom deserializer didn't work, but I'll see if I can find a way