-
Notifications
You must be signed in to change notification settings - Fork 126
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
gRPC refresh #2135
base: main
Are you sure you want to change the base?
gRPC refresh #2135
Conversation
This draft assumes tremor-rs/tremor-otelapis#16 will be merged at some point - after we update github actions so that our CI has a working |
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.
Woooh! Much grpc!
@@ -10,15 +10,22 @@ | |||
## [0.13.0-rc.3] | |||
|
|||
### New features | |||
|
|||
- Otel rebased to v19 specification version and deprecated v18 features removed. Breaking change. |
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 got to move up to "Unreleased"
Cargo.toml
Outdated
prost = "0.9.0" | ||
prost-types = "0.9.0" | ||
tremor-otelapis = { version = "0.2.4" } | ||
tremor-otelapis = { path = "../tremor-otelapis" } # WAS ... , version = "0.2.5" } |
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.
I think this needs to change back to the version before we can merge it
@@ -241,6 +245,10 @@ uuid = { version = "1.1", features = ["v4"] } | |||
|
|||
# wal | |||
qwal = { git = "https://github.com/tremor-rs/qwal" } | |||
warp = "0.3.3" |
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.
probably should move up to the GCP section
@@ -28,6 +28,7 @@ pub(crate) fn insert_id(meta: Option<&Value>) -> String { | |||
get_or_default(meta, "insert_id") | |||
} | |||
|
|||
#[allow(clippy::cast_possible_wrap)] // casting seconds to u64 here is safe |
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.
<3 love the explaining comment! We should always do that!
otherwise => Some(std::time::Duration::from_nanos(otherwise).into()), | ||
otherwise => { | ||
let mut duration = prost_types::Duration { | ||
seconds: otherwise as i64 / 1_000_000_000i64, |
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.
fringe case but should we move the cast to the outside to ensure we're not loosing a bit?
seconds: otherwise as i64 / 1_000_000_000i64, | |
seconds: (otherwise / 1_000_000_000u64) as i64, |
if let Some(split) = has_meta.get("split") { | ||
return Some(LogSplit { | ||
uid: split.get("uid").as_str().unwrap_or("").to_string(), | ||
index: split.get("line").as_i32().unwrap_or(0), | ||
total_splits: split.get("total_splits").as_i32().unwrap_or(0), | ||
}); | ||
} | ||
|
||
// Otherwise, None as mapping is optional | ||
None |
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.
Option allows for ?
which lets us unnest the code here, and get_<type>
on value combines get and as :)
if let Some(split) = has_meta.get("split") { | |
return Some(LogSplit { | |
uid: split.get("uid").as_str().unwrap_or("").to_string(), | |
index: split.get("line").as_i32().unwrap_or(0), | |
total_splits: split.get("total_splits").as_i32().unwrap_or(0), | |
}); | |
} | |
// Otherwise, None as mapping is optional | |
None | |
let split = has_meta.get("split")?; | |
Some(LogSplit { | |
uid: split.get_str("uid").unwrap_or("").to_string(), | |
index: split.get_i32("line").unwrap_or(0), | |
total_splits: split.get_i32("total_splits").unwrap_or(0), | |
}) |
value: maybe_from_value(data.get("value"))?, | ||
value: match data.get("value") { | ||
Some(Value::Static(StaticNode::F64(v))) => Some(exemplar::Value::AsDouble(*v)), | ||
Some(Value::Static(StaticNode::I64(v))) => Some(exemplar::Value::AsInt(*v)), |
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.
It's important to use as_i64
instead of matching on the value here otherwise it'll not match for other number types (like u64 or later 128 bit types that would "fit") (Same below)
@@ -208,13 +208,13 @@ sled = "0.34" | |||
|
|||
# opentelemetry | |||
port_scanner = "0.1.5" | |||
tonic = { version = "0.6.1", default-features = false, features = [ | |||
tonic = { version = "0.8.2", default-features = false, features = [ |
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.
tonic = { version = "0.8.2", default-features = false, features = [ | |
tonic = { version = "0.8.3", default-features = false, features = [ |
Signed-off-by: Darach Ennis <[email protected]>
Signed-off-by: Darach Ennis <[email protected]>
Signed-off-by: Darach Ennis <[email protected]>
Signed-off-by: Darach Ennis <[email protected]>
Signed-off-by: Darach Ennis <[email protected]>
Signed-off-by: Darach Ennis <[email protected]>
d746943
to
165a999
Compare
Signed-off-by: Darach Ennis <[email protected]>
Does it make sense to keep this PR or a have things changed far enough after two years that it's worth closing this and taking a fresh look with the new connector design? |
Pull request
gRPC refresh.
Provoked by original work by @dak-x to add compression support to the otel connectors he discovered
that a lot more work would be required to upgrade tremor's gRPC connectivity across the board due to
changes in tonic ( gRPC ) and prost ( protobuf ) and changes to the protobuf specifications for OpenTelemetry
and the GCP connectors in tremor that leverage gRPC.
The relatively small and simple change. Was now no more a simple and quick undertaking.
This pull request captures the functional changes required to complete that work pending acceptance
tests against all the affected connectors as changes to GCP pulled in a new untested authentication
mechanism and library.
Once acceptance tests have been conducted the 😭 sob emoji may be removed and this draft promoted
to a full pull request.
Description
See above.
Related
Checklist
Performance
No functional or critical path changes - changes to generated tonic/prost should be negligeable but we do not have CI for GCP based connectors at this time so have no automated guarantees or assurances in our CI/CD systems at this time.