-
Notifications
You must be signed in to change notification settings - Fork 672
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
SMQ-2648 - Add API and Repository implementation for the Client stats #2647
Conversation
7750fa4
to
c52b865
Compare
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 OK to use Journal service as telemetry aggregator, but we should consider using some actual telemetry collectors for event processing. I.e. we can use journaling service as a final destination and apply access control and some processing to provide nice API, but what we need is an integration with telemetry collectors that will consume events, process them, store them, and provide search and filtering on them. Then, we need a background task to sync Journal service with them. Take a look at Elastic, Prometheus, InfluxDB.
c52b865
to
d166090
Compare
d166090
to
8be714b
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2647 +/- ##
==========================================
+ Coverage 45.34% 52.43% +7.08%
==========================================
Files 345 16 -329
Lines 44305 883 -43422
==========================================
- Hits 20092 463 -19629
+ Misses 22029 394 -21635
+ Partials 2184 26 -2158 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Felix Gateru <[email protected]>
Signed-off-by: Felix Gateru <[email protected]>
Signed-off-by: Felix Gateru <[email protected]>
abb9930
to
ab32e02
Compare
Signed-off-by: Felix Gateru <[email protected]>
journal/journal.go
Outdated
@@ -137,6 +137,17 @@ func (page JournalsPage) MarshalJSON() ([]byte, error) { | |||
return json.Marshal(a) | |||
} | |||
|
|||
type ClientsTelemetry struct { |
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.
Use singular ClientTelemetry
instead, since this is a telemetry for a single client.
journal/journal.go
Outdated
type ClientsTelemetry struct { | ||
ClientID string `json:"client_id"` | ||
DomainID string `json:"domain_id"` | ||
Connections []string `json:"connections"` |
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.
There is no need for connections, we already have it in the Client.
journal/postgres/journal.go
Outdated
@@ -102,6 +104,71 @@ func (repo *repository) RetrieveAll(ctx context.Context, page journal.Page) (jou | |||
return journalsPage, nil | |||
} | |||
|
|||
func (repo *repository) SaveClientTelemetry(ctx context.Context, ct journal.ClientsTelemetry) error { |
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.
Create a separate file for telemetry implementation in telemetry,go
.
…y, move repo impl to telemetry.go Signed-off-by: Felix Gateru <[email protected]>
What type of PR is this?
This is a feature because it adds clients telemetry to the journals service
What does this do?
This pr adds a means to monitor information about clients
Which issue(s) does this PR fix/relate to?
Have you included tests for your changes?
No,
Did you document any new/modified feature?
No
Notes