Skip to content

Conversation

@jbuchbinder
Copy link
Contributor

No description provided.

@tsaikd
Copy link
Owner

tsaikd commented Mar 28, 2025

@jbuchbinder
Copy link
Contributor Author

Lint issues fixed, as requested.

// Decode lines, every metric is an possible individual event
{
e := event
err = c.decodePrometheusEvent(line, savetype, &e)
Copy link
Owner

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?

Copy link
Contributor Author

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 ...
Copy link
Owner

@tsaikd tsaikd Apr 2, 2025

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?

Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants