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

Set event.module for hostmetrics remapper #43

Merged
merged 1 commit into from
Jul 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions remappers/common/const.go
Original file line number Diff line number Diff line change
@@ -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
@@ -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)
}
1 change: 1 addition & 0 deletions remappers/hostmetrics/hostmetrics_test.go
Original file line number Diff line number Diff line change
@@ -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