Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

Commit

Permalink
write only CHART if obsolete (#1370)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyam8 authored Oct 13, 2023
1 parent 11e0298 commit 1cfccdc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions agent/module/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,11 @@ func (j *Job) createChart(chart *Chart) {
j.moduleName,
)

if chart.Obsolete {
_ = j.api.EMPTYLINE()
return
}

seen := make(map[string]bool)
for _, l := range chart.Labels {
if l.Key != "" {
Expand Down
2 changes: 1 addition & 1 deletion agent/netdataapi/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const quotes = "' '"

var (
end = []byte("END\n\n")
clabelCommit = []byte("CLABEL_COMMIT\n\n")
clabelCommit = []byte("CLABEL_COMMIT\n")
newLine = []byte("\n")
)

Expand Down
2 changes: 1 addition & 1 deletion agent/netdataapi/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ func TestAPI_CLABELCOMMIT(t *testing.T) {

assert.Equal(
t,
"CLABEL_COMMIT\n\n",
"CLABEL_COMMIT\n",
buf.String(),
)
}
Expand Down

0 comments on commit 1cfccdc

Please sign in to comment.