Skip to content
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

line_parser.go:158: cannot parse docker message, invalid JSON: #1000

Merged
merged 4 commits into from
Jul 11, 2024

Conversation

2005wind
Copy link
Contributor

Fix 在containerd日志格式下,错误日志匹配。以及query 日志太多

@@ -134,7 +134,9 @@ func (kc *kubeletClient) query(ctx context.Context, path string) ([]byte, int, e
return nil, 0, err
}

log.Printf("Successfully queried %s, status code: %d, body len: %d", req.URL.String(), response.StatusCode, len(b))
if coreconfig.Config.DebugMode {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

有个单独针对logs-agent的debug 判断 util.Debug()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已经修改了。

@@ -200,6 +200,10 @@ func (l *Launcher) addSource(svc *service.Service) {
// force setting source type to kubernetes
source.SetSourceType(logsconfig.KubernetesSourceType)

// Determine whether CRI uses containerd
if pod.Status.Containers[0].ID[:13] == "containerd://" {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里会不会panic ?

Copy link
Contributor Author

@2005wind 2005wind Jul 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不好意思。 第一次写golang, 不是很熟悉。也修改了。这样应该不会panic了。

@kongfei605
Copy link
Collaborator

Thank you @2005wind

@kongfei605 kongfei605 merged commit 6d33b90 into flashcatcloud:main Jul 11, 2024
2 of 3 checks passed
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