Skip to content

Commit

Permalink
Set event.module for hostmetrics remapper (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
lahsivjar authored Jul 10, 2024
1 parent 996ceaa commit eb81786
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions remappers/common/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ const (
// EventDatasetLabel defines the event dataset label key.
EventDatasetLabel = "event.dataset"

// EventModuleLabel defines the event module label key.
EventModuleLabel = "event.module"

// OTelRemappedLabel is used to identify remapped metrics.
OTelRemappedLabel = "otel_remapped"
)
1 change: 1 addition & 0 deletions remappers/hostmetrics/hostmetrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ func (r *Remapper) Remap(
}
datasetMutator := func(m pmetric.NumberDataPoint) {
m.Attributes().PutStr(common.EventDatasetLabel, dataset)
m.Attributes().PutStr(common.EventModuleLabel, "system")
if r.cfg.SystemIntegrationDataset {
m.Attributes().PutStr(common.DatastreamDatasetLabel, dataset)
}
Expand Down
1 change: 1 addition & 0 deletions remappers/hostmetrics/hostmetrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ func doTestRemap(t *testing.T, id string, remapOpts ...Option) {
m := map[string]any{
common.OTelRemappedLabel: true,
common.EventDatasetLabel: dataset,
common.EventModuleLabel: "system",
}
if systemIntegration {
m[common.DatastreamDatasetLabel] = dataset
Expand Down

0 comments on commit eb81786

Please sign in to comment.