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

logger: adjust logger to receive logs blobs #1172

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
40a3a79
codegen: removed the otel layer generation
iulianbarbu Aug 22, 2023
1339888
proto: updated logger proto file
iulianbarbu Aug 22, 2023
7615495
logger: add store_logs RPC impl
iulianbarbu Aug 22, 2023
12fea55
logger: fixed tests
iulianbarbu Aug 23, 2023
6f7c1da
logger: decreased the visibility for Log type
iulianbarbu Aug 23, 2023
616fe2b
logger: remove the unwrap
iulianbarbu Aug 23, 2023
a9c0bd5
proto/logger: differentiate between a fetched/stored log items
iulianbarbu Aug 23, 2023
4c46e57
logger: simplify tests
iulianbarbu Aug 24, 2023
c813a61
runtime: removed tracing/otel dependencies
iulianbarbu Aug 24, 2023
2411767
runtime: removed the tracing dependencies
iulianbarbu Aug 24, 2023
3bae7ab
codegen: cleanup tracing layers and tests
iulianbarbu Aug 24, 2023
9e0fb45
runtime/next: fix compilation
iulianbarbu Aug 24, 2023
fc255d6
logger: remove claim verification on store_logs
iulianbarbu Aug 24, 2023
b1ab984
logger: implemented from_stored for StoredLogItem convertion to Log
iulianbarbu Aug 24, 2023
093e223
codegen: readd a missing import
iulianbarbu Aug 24, 2023
35f737e
codegen: fix tests
iulianbarbu Aug 24, 2023
ceaa9ff
addressed P review
iulianbarbu Aug 24, 2023
2659387
logger: removed integration test comment
iulianbarbu Aug 24, 2023
bf9c9b8
logger/tests: remove the DeploymentPush claim scope
iulianbarbu Aug 24, 2023
5fb7053
address orhun feedback
iulianbarbu Aug 24, 2023
ae860f5
logger: fixed error message typo
iulianbarbu Aug 24, 2023
67781d4
address Johan review
iulianbarbu Aug 24, 2023
53e7369
logger/proto: remove dedup protobuf defs
iulianbarbu Aug 24, 2023
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
Prev Previous commit
Next Next commit
proto/logger: differentiate between a fetched/stored log items
  • Loading branch information
iulianbarbu committed Aug 24, 2023
commit a9c0bd5630a9c831f44185f0c73049dc2547f6eb
14 changes: 10 additions & 4 deletions proto/logger.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ service Logger {
rpc GetLogs(LogsRequest) returns (LogsResponse);

// Get fresh logs as they are incoming
rpc GetLogsStream(LogsRequest) returns (stream LogItem);
rpc GetLogsStream(LogsRequest) returns (stream FetchedLogItem);
}

message StoreLogsRequest {
repeated LogItem logs = 1;
repeated StoredLogItem logs = 1;
}

message StoreLogsResponse {
Expand All @@ -27,12 +27,18 @@ message LogsRequest {
}

message LogsResponse {
repeated LogItem log_items = 1;
repeated FetchedLogItem log_items = 1;
}

message LogItem {
message StoredLogItem {
string service_name = 1;
string deployment_id = 2;
google.protobuf.Timestamp tx_timestamp = 3;
bytes data = 4;
}

message FetchedLogItem {
string service_name = 1;
google.protobuf.Timestamp tx_timestamp = 2;
bytes data = 3;
iulianbarbu marked this conversation as resolved.
Show resolved Hide resolved
}
22 changes: 16 additions & 6 deletions proto/src/generated/logger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StoreLogsRequest {
#[prost(message, repeated, tag = "1")]
pub logs: ::prost::alloc::vec::Vec<LogItem>,
pub logs: ::prost::alloc::vec::Vec<StoredLogItem>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
Expand All @@ -20,11 +20,11 @@ pub struct LogsRequest {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LogsResponse {
#[prost(message, repeated, tag = "1")]
pub log_items: ::prost::alloc::vec::Vec<LogItem>,
pub log_items: ::prost::alloc::vec::Vec<FetchedLogItem>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LogItem {
pub struct StoredLogItem {
#[prost(string, tag = "1")]
pub service_name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
Expand All @@ -34,6 +34,16 @@ pub struct LogItem {
#[prost(bytes = "vec", tag = "4")]
pub data: ::prost::alloc::vec::Vec<u8>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FetchedLogItem {
#[prost(string, tag = "1")]
pub service_name: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub tx_timestamp: ::core::option::Option<::prost_types::Timestamp>,
#[prost(bytes = "vec", tag = "3")]
pub data: ::prost::alloc::vec::Vec<u8>,
}
/// Generated client implementations.
pub mod logger_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
Expand Down Expand Up @@ -144,7 +154,7 @@ pub mod logger_client {
&mut self,
request: impl tonic::IntoRequest<super::LogsRequest>,
) -> Result<
tonic::Response<tonic::codec::Streaming<super::LogItem>>,
tonic::Response<tonic::codec::Streaming<super::FetchedLogItem>>,
tonic::Status,
> {
self.inner
Expand Down Expand Up @@ -183,7 +193,7 @@ pub mod logger_server {
) -> Result<tonic::Response<super::LogsResponse>, tonic::Status>;
/// Server streaming response type for the GetLogsStream method.
type GetLogsStreamStream: futures_core::Stream<
Item = Result<super::LogItem, tonic::Status>,
Item = Result<super::FetchedLogItem, tonic::Status>,
>
+ Send
+ 'static;
Expand Down Expand Up @@ -331,7 +341,7 @@ pub mod logger_server {
T: Logger,
> tonic::server::ServerStreamingService<super::LogsRequest>
for GetLogsStreamSvc<T> {
type Response = super::LogItem;
type Response = super::FetchedLogItem;
type ResponseStream = T::GetLogsStreamStream;
type Future = BoxFuture<
tonic::Response<Self::ResponseStream>,
Expand Down
10 changes: 10 additions & 0 deletions proto/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,4 +232,14 @@ pub mod resource_recorder {

pub mod logger {
include!("generated/logger.rs");

impl From<StoredLogItem> for FetchedLogItem {
fn from(value: StoredLogItem) -> Self {
FetchedLogItem {
service_name: value.service_name,
tx_timestamp: value.tx_timestamp,
data: value.data,
}
}
}
}