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

[pull] master from vectordotdev:master #2

Merged
merged 6 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
44 changes: 22 additions & 22 deletions Cargo.lock

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

15 changes: 8 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,9 @@ members = [

[workspace.dependencies]
chrono = { version = "0.4.33", default-features = false, features = ["clock", "serde"] }
pin-project = { version = "1.1.4", default-features = false }
clap = { version = "4.4.18", default-features = false, features = ["derive", "error-context", "env", "help", "std", "string", "usage", "wrap_help"] }
pin-project = { version = "1.1.4", default-features = false }
serde_json = { version = "1.0.112", default-features = false, features = ["raw_value", "std"] }
vrl = { version = "0.9.1", features = ["arbitrary", "cli", "test", "test_framework"] }

[dependencies]
Expand Down Expand Up @@ -174,11 +175,11 @@ aws-sdk-kinesis = { version = "1.3.0", default-features = false, features = ["be
aws-types = { version = "1.1.3", default-features = false, optional = true }
aws-sigv4 = { version = "1.1.3", default-features = false, features = ["sign-http"], optional = true }
aws-config = { version = "1.0.1", default-features = false, features = ["behavior-version-latest"], optional = true }
aws-credential-types = { version = "1.1.3", default-features = false, features = ["hardcoded-credentials"], optional = true }
aws-credential-types = { version = "1.1.4", default-features = false, features = ["hardcoded-credentials"], optional = true }
aws-smithy-http = { version = "0.60", default-features = false, features = ["event-stream"], optional = true }
aws-smithy-types = { version = "1.0.2", default-features = false, optional = true }
aws-smithy-runtime-api = { version = "1.1.3", default-features = false, optional = true }
aws-smithy-runtime = { version = "1.1.3", default-features = false, features = ["client", "connector-hyper-0-14-x", "rt-tokio"], optional = true }
aws-smithy-runtime = { version = "1.1.4", default-features = false, features = ["client", "connector-hyper-0-14-x", "rt-tokio"], optional = true }
aws-smithy-async = { version = "1.0.2", default-features = false, features = ["rt-tokio"], optional = true }

# Azure
Expand All @@ -197,7 +198,7 @@ tower-http = { version = "0.4.4", default-features = false, features = ["decompr
serde = { version = "1.0.195", default-features = false, features = ["derive"] }
serde-toml-merge = { version = "0.3.3", default-features = false }
serde_bytes = { version = "0.11.14", default-features = false, features = ["std"], optional = true }
serde_json = { version = "1.0.111", default-features = false, features = ["raw_value"] }
serde_json.workspace = true
serde_with = { version = "3.5.0", default-features = false, features = ["macros", "std"] }
serde_yaml = { version = "0.9.30", default-features = false }

Expand Down Expand Up @@ -275,13 +276,13 @@ hyper-proxy = { version = "0.9.1", default-features = false, features = ["openss
indexmap = { version = "2.1.0", default-features = false, features = ["serde", "std"] }
infer = { version = "0.15.0", default-features = false, optional = true}
indoc = { version = "2.0.4", default-features = false }
inventory = { version = "0.3.14", default-features = false }
inventory = { version = "0.3.15", default-features = false }
itertools = { version = "0.12.0", default-features = false, optional = false, features = ["use_alloc"] }
k8s-openapi = { version = "0.18.0", default-features = false, features = ["api", "v1_26"], optional = true }
kube = { version = "0.82.0", default-features = false, features = ["client", "openssl-tls", "runtime"], optional = true }
listenfd = { version = "1.0.1", default-features = false, optional = true }
logfmt = { version = "0.0.2", default-features = false, optional = true }
lru = { version = "0.12.1", default-features = false, optional = true }
lru = { version = "0.12.2", default-features = false, optional = true }
maxminddb = { version = "0.24.0", default-features = false, optional = true }
md-5 = { version = "0.10", default-features = false, optional = true }
mongodb = { version = "2.8.0", default-features = false, features = ["tokio-runtime"], optional = true }
Expand Down Expand Up @@ -347,7 +348,7 @@ openssl-src = { version = "300", default-features = false, features = ["force-en
[dev-dependencies]
approx = "0.5.1"
assert_cmd = { version = "2.0.13", default-features = false }
aws-smithy-runtime = { version = "1.1.3", default-features = false, features = ["tls-rustls"] }
aws-smithy-runtime = { version = "1.1.4", default-features = false, features = ["tls-rustls"] }
azure_core = { version = "0.17", default-features = false, features = ["enable_reqwest", "azurite_workaround"] }
azure_identity = { version = "0.17", default-features = false, features = ["enable_reqwest"] }
azure_storage_blobs = { version = "0.17", default-features = false, features = ["azurite_workaround"] }
Expand Down
39 changes: 26 additions & 13 deletions docs/tutorials/sinks/1_basic_sink.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ Provide some module level comments to explain what the sink does.
Let's setup all the imports we will need for the tutorial:

```rust
use crate::prelude::*;
use crate::sinks::prelude::*;
use vector_lib::internal_event::{
ByteSize, BytesSent, EventsSent, InternalEventHandle, Output, Protocol,
};
```

# Configuration
Expand Down Expand Up @@ -253,15 +256,13 @@ emit the event. Change the body of `run_inner` to look like the following:

```diff
async fn run_inner(self: Box<Self>, mut input: BoxStream<'_, Event>) -> Result<(), ()> {
+ let bytes_sent = register!(BytesSent::from(Protocol("console".into(),)));

while let Some(mut event) = input.next().await {
+ let bytes = format!("{:#?}", event);
+ println!("{}", bytes);
- println!("{:#?}", event);

+ emit!(BytesSent {
+ byte_size: bytes.len(),
+ protocol: "none".into()
+ });
+ bytes_sent.emit(ByteSize(bytes.len()));

let finalizers = event.take_finalizers();
finalizers.update_status(EventStatus::Delivered);
Expand All @@ -276,15 +277,27 @@ emit the event. Change the body of `run_inner` to look like the following:
[`EventSent`][events_sent] is emitted by each component in Vector to
instrument how many bytes have been sent to the next downstream component.

Add the following after emitting `BytesSent`:
Change the body of `run_inner` to look like the following:

```diff
+ let event_byte_size = event.estimated_json_encoded_size_of();
+ emit!(EventsSent {
+ count: 1,
+ byte_size: event_byte_size,
+ output: None,
+ });
async fn run_inner(self: Box<Self>, mut input: BoxStream<'_, Event>) -> Result<(), ()> {
let bytes_sent = register!(BytesSent::from(Protocol("console".into(),)));
+ let events_sent = register!(EventsSent::from(Output(None)));

while let Some(mut event) = input.next().await {
let bytes = format!("{:#?}", event);
println!("{}", bytes);
bytes_sent.emit(ByteSize(bytes.len()));

+ let event_byte_size = event.estimated_json_encoded_size_of();
+ events_sent.emit(CountByteSize(1, event_byte_size));

let finalizers = event.take_finalizers();
finalizers.update_status(EventStatus::Delivered);
}

Ok(())
}
```

More details about instrumenting Vector can be found
Expand Down
2 changes: 1 addition & 1 deletion lib/codecs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ prost = { version = "0.12.3", default-features = false, features = ["std"] }
prost-reflect = { version = "0.12", default-features = false, features = ["serde"] }
regex = { version = "1.10.3", default-features = false, features = ["std", "perf"] }
serde = { version = "1", default-features = false, features = ["derive"] }
serde_json = { version = "1", default-features = false }
serde_json.workspace = true
smallvec = { version = "1", default-features = false, features = ["union"] }
snafu = { version = "0.7.5", default-features = false, features = ["futures"] }
syslog_loose = { version = "0.21", default-features = false, optional = true }
Expand Down
2 changes: 1 addition & 1 deletion lib/docs-renderer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ publish = false
[dependencies]
anyhow = { version = "1.0.79", default-features = false, features = ["std"] }
serde = { version = "1.0", default-features = false }
serde_json = { version = "1.0", default-features = false, features = ["std"] }
serde_json.workspace = true
snafu = { version = "0.7.5", default-features = false }
tracing = { version = "0.1.34", default-features = false }
tracing-subscriber = { version = "0.3.18", default-features = false, features = ["ansi", "env-filter", "fmt", "json", "registry", "tracing-log"] }
Expand Down
2 changes: 1 addition & 1 deletion lib/k8s-e2e-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ k8s-openapi = { version = "0.16.0", default-features = false, features = ["v1_19
k8s-test-framework = { version = "0.1", path = "../k8s-test-framework" }
regex = "1"
reqwest = { version = "0.11.23", features = ["json"] }
serde_json = "1"
serde_json.workspace = true
tokio = { version = "1.35.1", features = ["full"] }
indoc = "2.0.4"
env_logger = "0.10"
Expand Down
2 changes: 1 addition & 1 deletion lib/k8s-test-framework/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ license = "MPL-2.0"

[dependencies]
k8s-openapi = { version = "0.16.0", default-features = false, features = ["v1_19"] }
serde_json = "1"
serde_json.workspace = true
tempfile = "3"
tokio = { version = "1.35.1", features = ["full"] }
log = "0.4"
2 changes: 1 addition & 1 deletion lib/vector-api-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ license = "MPL-2.0"

# Serde
serde = { version = "1.0.195", default-features = false, features = ["derive"] }
serde_json = { version = "1.0.111", default-features = false, features = ["raw_value"] }
serde_json.workspace = true

# Error handling
anyhow = { version = "1.0.79", default-features = false, features = ["std"] }
Expand Down
2 changes: 1 addition & 1 deletion lib/vector-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ ordered-float = { version = "4.2.0", default-features = false }
paste = "1.0.14"
pin-project.workspace = true
ryu = { version = "1", default-features = false }
serde_json = { version = "1.0.111", default-features = false, features = ["std", "raw_value"] }
serde_json.workspace = true
serde = { version = "1.0.195", optional = true, features = ["derive"] }
smallvec = { version = "1", default-features = false }
snafu = { version = "0.7", optional = true }
Expand Down
2 changes: 1 addition & 1 deletion lib/vector-config-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ darling = { version = "0.20", default-features = false, features = ["suggestions
once_cell = { version = "1", default-features = false, features = ["std"] }
proc-macro2 = { version = "1.0", default-features = false }
serde = { version = "1.0", default-features = false, features = ["derive"] }
serde_json = { version = "1.0", default-features = false, features = ["std"] }
serde_json.workspace = true
syn = { version = "2.0", features = ["full", "extra-traits", "visit-mut", "visit"] }
tracing = { version = "0.1.34", default-features = false }
quote = { version = "1.0", default-features = false }
2 changes: 1 addition & 1 deletion lib/vector-config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ inventory = { version = "0.3" }
no-proxy = { version = "0.3.4", default-features = false, features = ["serialize"] }
num-traits = { version = "0.2.17", default-features = false }
serde = { version = "1.0", default-features = false }
serde_json = { version = "1.0", default-features = false, features = ["std"] }
serde_json.workspace = true
serde_with = { version = "3.5.0", default-features = false, features = ["std"] }
snafu = { version = "0.7.5", default-features = false }
toml = { version = "0.8.8", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion lib/vector-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ quanta = { version = "0.12.2", default-features = false }
regex = { version = "1.10.3", default-features = false, features = ["std", "perf"] }
ryu = { version = "1", default-features = false }
serde = { version = "1.0.195", default-features = false, features = ["derive", "rc"] }
serde_json = { version = "1.0.111", default-features = false }
serde_json.workspace = true
serde_with = { version = "3.5.0", default-features = false, features = ["std", "macros"] }
smallvec = { version = "1", default-features = false, features = ["serde", "const_generics"] }
snafu = { version = "0.7.5", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion lib/vector-vrl/tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ glob = "0.3"
prettydiff = "0.6"
regex = "1"
serde = "1"
serde_json = "1"
serde_json.workspace = true
tracing-subscriber = { version = "0.3.18", default-features = false, features = ["fmt"] }

[target.'cfg(not(target_env = "msvc"))'.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion lib/vector-vrl/web-playground/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ vector-vrl-functions = { path = "../functions" }
enrichment = { path = "../../enrichment" }

[build-dependencies]
cargo_toml = "0.18.0"
cargo_toml = "0.19.0"
2 changes: 1 addition & 1 deletion vdev/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ paste = "1.0.14"
regex = { version = "1.10.3", default-features = false, features = ["std", "perf"] }
reqwest = { version = "0.11", features = ["json", "blocking"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0.111"
serde_json.workspace = true
serde_yaml = "0.9.30"
sha2 = "0.10.8"
tempfile = "3.9.0"
Expand Down
Loading