-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename fpx to fpx-cli and fpx-lib to fpx (#446)
* Rename fpx to fpx-cli and fpx-lib to fpx * Update cargo alias * Fix build * Refactor ApiClientErrors * Move ApiClientError related tests to its module
- Loading branch information
Showing
59 changed files
with
1,080 additions
and
1,254 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[alias] | ||
fpx = "run --package fpx --" | ||
fpx = "run --package fpx-cli --" | ||
xtask = "run --package xtask --" |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
[workspace] | ||
resolver = "2" | ||
members = ["fpx", "fpx-lib", "fpx-workers", "fpx-macros", "xtask"] | ||
default-members = ["fpx"] | ||
members = ["fpx-cli", "fpx", "fpx-workers", "fpx-macros", "xtask"] | ||
|
||
[workspace.package] | ||
authors = ["Fiberplane <[email protected]>"] | ||
|
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,80 @@ | ||
[package] | ||
name = "fpx-cli" | ||
version = { workspace = true } | ||
edition = "2021" | ||
authors = { workspace = true } | ||
license = { workspace = true } | ||
repository = { workspace = true } | ||
|
||
[features] | ||
embed-studio = [] # When enabled it will embed Studio from frontend/dist | ||
|
||
[dependencies] | ||
anyhow = { workspace = true } | ||
async-trait = { version = "0.1" } | ||
axum = { workspace = true, default-features = false, features = [ | ||
"http1", | ||
"query", | ||
"tokio", | ||
"tracing", | ||
"ws", | ||
] } | ||
bytes = { version = "1.6" } | ||
clap = { workspace = true, features = ["derive", "env"] } | ||
fpx = { version = "0.1.0", path = "../fpx", features = [ | ||
"libsql", | ||
"fpx_client", | ||
] } | ||
fpx-macros = { version = "0.1.0", path = "../fpx-macros" } | ||
futures-util = { version = "0.3" } | ||
hex = { version = "0.4" } | ||
http = { version = "1.1" } | ||
http-body-util = { version = "0.1" } | ||
include_dir = { version = "0.7.3" } | ||
libsql = { version = "0.6", default-features = false, features = [ | ||
"core", | ||
"serde", | ||
] } | ||
once_cell = { version = "1.19" } | ||
opentelemetry = { version = "0.27" } | ||
opentelemetry_sdk = { version = "0.27", features = ["rt-tokio"] } | ||
opentelemetry-otlp = { version = "0.27", features = [ | ||
"http-json", | ||
"reqwest-client", | ||
"reqwest-rustls-webpki-roots", | ||
] } | ||
opentelemetry-proto = { version = "0.27", features = [ | ||
"gen-tonic-messages", | ||
"with-serde", | ||
"with-schemars", | ||
] } | ||
prost = { version = "0.13" } | ||
rand = { version = "0.8.5" } | ||
schemars = { workspace = true } | ||
serde = { workspace = true } | ||
serde_json = { workspace = true } | ||
serde_with = { version = "3.8.1" } | ||
strum = { version = "0.26", features = ["derive"] } | ||
thiserror = { version = "2.0" } | ||
time = { version = "0.3.17", features = ["serde-human-readable"] } | ||
tokio = { version = "1.40", features = ["rt-multi-thread", "signal", "fs"] } | ||
tokio-tungstenite = { version = "0.21", features = [ | ||
"rustls-tls-webpki-roots", | ||
] } # This should be kept the same as whatever Axum has | ||
toml = { version = "0.8" } | ||
tonic = { version = "0.12" } | ||
tower = { version = "0.4" } | ||
tracing = { version = "0.1" } | ||
tracing-opentelemetry = { version = "0.28" } | ||
tracing-subscriber = { version = "0.3", features = ["env-filter"] } | ||
url = { version = "2.5" } | ||
|
||
[target.'cfg(windows)'.dependencies] | ||
libsql = { version = "0.6", default-features = false, features = [ | ||
"core", | ||
"serde", | ||
"replication", | ||
] } | ||
|
||
[dev-dependencies] | ||
test-log = { version = "0.2", default-features = false, features = ["trace"] } |
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,55 @@ | ||
# fpx | ||
|
||
The fpx tool is a command line tool to launch a local HTTP or gRPC OTEL | ||
ingestion endpoint. It also includes a CLI client to interact with some of the | ||
Rest and web-socket endpoints. | ||
|
||
NOTE: Currently only a in-memory storage is supported. | ||
|
||
## Usage | ||
|
||
First, make sure you have Rust installed on your machine. You can install Rust | ||
using [rustup](https://rustup.rs/) or take a look at the | ||
[official instructions](https://www.rust-lang.org/tools/install). | ||
|
||
Then run the following command to execute the local dev server: | ||
|
||
``` | ||
cargo run -- dev | ||
``` | ||
|
||
See `Commands` for more information. | ||
|
||
## Commands | ||
|
||
The fpx binary is primarily used to start a local dev server, but it is also | ||
possible to run some other commands. | ||
|
||
For ease of use, the `fpx` cargo alias has been added, meaning you can run | ||
`cargo fpx` in any directory in this repository and compile and then invoke | ||
`fpx`. | ||
|
||
### `fpx dev` | ||
|
||
Starts the local dev server. | ||
|
||
Use `-e` or `--enable-tracing` to send otlp payloads to `--otlp-endpoint`. Note | ||
that this should not be used to send traces to itself, as that will create an | ||
infinite loop. | ||
|
||
### `fpx client` | ||
|
||
Invokes endpoints on a fpx server. | ||
|
||
This command can also send traces to a otel endpoint. NOTE: there are some known | ||
issues where it doesn't seem to work properly. | ||
|
||
Examples: | ||
|
||
``` | ||
# Fetch all traces | ||
fpx client traces list | ||
# Fetch a specific span | ||
fpx client spans get aa aa | ||
``` |
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
fpx/src/commands/client/spans.rs → fpx-cli/src/commands/client/spans.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
2 changes: 1 addition & 1 deletion
2
fpx/src/commands/client/traces.rs → fpx-cli/src/commands/client/traces.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.
2 changes: 1 addition & 1 deletion
2
fpx/src/commands/debug/ws.rs → fpx-cli/src/commands/debug/ws.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
File renamed without changes.
File renamed without changes.
Oops, something went wrong.