-
Notifications
You must be signed in to change notification settings - Fork 106
[codec] prometheus : initial implementation of prometheus wire codec #244
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
base: master
Are you sure you want to change the base?
Conversation
|
Please fix lint issues: https://github.com/tsaikd/gogstash/actions/runs/14107953286/job/39518884619?pr=244 |
|
Lint issues fixed, as requested. |
| // Decode lines, every metric is an possible individual event | ||
| { | ||
| e := event | ||
| err = c.decodePrometheusEvent(line, savetype, &e) |
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.
e1 := logevent.LogEvent{
Extra: map[string]any{
"foo": "bar",
},
}
e2 := e1
e2.Extra["foo"] = "omg" // e1.Extra["foo"] is also assigned to "omg"Is it what you want?
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 supposed to be a copy, not a reference. Rather than iteratively instantiating logevent.LogEvent{} objects, I was just trying to copy them and then modify then with the actual events.
Co-authored-by: Tsai KD <tsaikd@gmail.com>
| if err == nil { | ||
| select { | ||
| case <-ctx.Done(): | ||
| // error handling ... |
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.
Do you want to continue processing when ctx has been canceled?
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 not, since it would indicate the connection being closed.
No description provided.