-
Notifications
You must be signed in to change notification settings - Fork 10
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
[skmonitor] Add monitoring API #201
base: main
Are you sure you want to change the base?
Conversation
274f378
to
4c779b9
Compare
Bear with me here, I do plan to look at this. |
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 is great. I really like it.
Big +1 for using open telemetry - the data model (tree of spans, etc) looks solid to me, and we'll be able to utilise all the tools of that ecosystem.
Also, thanks for capturing all the memory info. That will be priceless.
What are your thoughts on the client? Due to the nature of the product, a lot of action is happening there. Should we log at all? Should we just expose to the user or should we try and capture this info somehow? Maybe make it opt in or out?
} | ||
|
||
fun read_line(): ?String { | ||
.read_line().map(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.
Will this end up copying?
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 don't think so.
module SKCSV; | ||
|
||
fun read_line(): ?String { | ||
SKDB.read_line() | ||
} | ||
|
||
fun skipExit<T>(res: Int): T { | ||
SKDB.skipExit(res) | ||
} | ||
|
||
fun print_error(error: String): void { | ||
SKDB.print_error(error) | ||
} | ||
|
||
fun print_raw(str: String): void { | ||
SKDB.print_raw(str) | ||
} | ||
|
||
fun print_string<T: readonly Show>(value: T): void { | ||
SKDB.print_string(value) | ||
} |
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.
Did you intend to capture stuff here?
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.
We need to manage the skipExit for clean exit and readline to get the number of read bytes.
The rest is to be belt and braces.
skmonitor/src/Monitor.sk
Outdated
if (!(monitoring() is MOn _)) return void; | ||
SKStore.switchToTrace(); | ||
low = get_session_low(); | ||
high = get_session_high(); | ||
traceId = TraceId::fromHighAndLow(high, low); | ||
optParent = get_span() match { | ||
| Some(parent) -> | ||
saved = SKStore.newObstack(); | ||
Some((parent, saved)) | ||
| _ -> | ||
initWriter(); | ||
None() | ||
}; | ||
span = mutable Span( | ||
now(), | ||
traceId, | ||
SpanId::fromInt(Random.next()), | ||
optParent, | ||
); | ||
set_span(Some(span)); | ||
SKStore.restoreFromTrace(); |
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.
Should we put restore in a finally block? Same for elsewhere obviously.
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 don't think so, there should never have exceptions during trace calls.
And just one other thing: we don't have any logging in the production side. So on the server it's SqlTailer.sk and on the client it's the combination of update and diff. Without this we can only see what was processed, but not what was sent. |
c0909fe
to
e0de197
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.
Looks good! Just a couple tiny comments
273bfd0
to
127c306
Compare
On the client side, I think we need to allow it with options for sending data to ours or/and app developer monitoring servers. |
aa40a35
to
823b7c0
Compare
823b7c0
to
0118b75
Compare
975b322
to
385cef5
Compare
385cef5
to
49922f1
Compare
8dc9fa0
to
361dcbd
Compare
ca4b08e
to
e382572
Compare
- Manage collector json log file - Manage uptrace dev endpoint - Add Uptrace utils - Manage SKDB collector metric - Manage SKDB uptrace dashboard
e382572
to
ab50d6b
Compare
No description provided.