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
New logs service with GetLogs API stub #9738
Conversation
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.
Looks good.
bazel run //:gazelle
is necessary. After that, expose logs.proto
to the proto generator by adding a rule in src/logs/BUILD.bazel like:
filegroup(
name = "protos",
srcs = glob(["*.proto"]),
visibility = ["//src:__pkg__"],
)
Then in src/BUILD.bazel, add //src/logs:protos
to the srcs
of all_protos
. Run bazel run //:buildifier
to make sure the srcs
list is sorted (otherwise //:buildifier_test will fail).
src/client/client.go
Outdated
@@ -85,6 +86,9 @@ type TransactionAPIClient transaction.APIClient | |||
// DebugClient is an alias of debug.DebugClient | |||
type DebugClient debug.DebugClient | |||
|
|||
// LogsClient is an alias of logs.APIClient |
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 would not add anything to the external client library. Users should just access our API via the Go gRPC bindings.
src/internal/client/client.go
Outdated
@@ -98,6 +102,7 @@ type APIClient struct { | |||
AdminAPIClient | |||
TransactionAPIClient | |||
DebugClient | |||
LogsClient |
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 know that you’re just copying the existing pattern here, which is fine, but I think that you should consider just adding a member rather than embedding here. I don’t think that there’s a need for embedding in this case — it just means being able to call logs.APIClient
methods on a Client
instance, when they don’t overlap with some other embedded type’s methods.
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.
no client changes now
src/logs/logs.proto
Outdated
message ParsedJSONLogMessage { | ||
VerbatimLogMessage verbatim = 1; // The verbatim line from Loki. | ||
//map<string, google.protobuf.Any> fields = 2; // A raw JSON parse of the entire line. | ||
map<string, string> fields = 2; // A raw JSON parse of the entire line. |
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.
The assumption here is that the JSON property values will always be strings. Is that guaranteed?
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.
changed to protobuf Struct
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #9738 +/- ##
==========================================
- Coverage 59.13% 59.01% -0.12%
==========================================
Files 582 583 +1
Lines 69908 69941 +33
==========================================
- Hits 41338 41278 -60
- Misses 27987 28089 +102
+ Partials 583 574 -9 ☔ View full report in Codecov by Sentry. |
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.
No issues with this, but a couple of requests/questions:
- Is this intended to be customer facing? Should the client expose this? Any new APIs (proto files) need to be manually exposed within the python client.
- if Yes: then make a ticket with the INT team so that we can get this exposed and maybe tested,
- If No: then I can show you where to disable the python generation for this file.
- Please move the comments/documentation to be above the fields. That's where the parser expects the documentation to be. Being inline now, none of this important information is making it into the generated python code.
LOG_FORMAT_PPS_LOGMESSAGE = 3; | ||
} | ||
|
||
message GetLogsRequest { |
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.
As this is the "entrance point" to the new RPC, could each of these fields get a little documentation? Additionally, could you move the comment above the field instead of inline? It makes the file longer, but the parser expects documentation for fields to be the line(s) immediately above the field definition.
src/logs/logs.proto
Outdated
string job = 2; | ||
} | ||
|
||
message PipelineDatumLogQuery { |
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.
Is this actually used anywhere?
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.
removed
1109060
to
cc75d03
Compare
2fe663f
to
5db2a45
Compare
e8dc9c1
to
8866685
Compare
will add more documentation in following PRs |
Could you provide some context on the reasoning or motivation behind this change? Other than that, the code itself looks good. |
It's a GetLogs API improvement |
Minimal changes for new logs service with single GetLogs API that has all the messages and types defined in logs.proto but only returns a dummy response for simple testing