Skip to content

Commit 184b680

Browse files
Fix ignore entity in SDK 4 (#160)
* Fix ignore entity in SDK 4
1 parent fc2c3f2 commit 184b680

File tree

4 files changed

+9
-0
lines changed

4 files changed

+9
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

8+
## 1.0.1 (2023-04-04)
9+
### Fixed
10+
- Creation of WIN_SERVICE entities
11+
812
## 1.0.0 (2023-03-16)
913
### Changed
1014
- Bump golang.org/x/sys from 0.4.0 to 0.5.0

src/nri/metricsProcesor.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ func createEntities(integrationInstance *integration.Integration, metricFamilyMa
8787
warnOnErr(err)
8888
continue
8989
}
90+
entity.SetIgnoreEntity(false)
9091
integrationInstance.AddEntity(entity)
9192

9293
entityMap[serviceName] = entity

src/nri/metricsProcesor_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ func TestCreateEntities(t *testing.T) {
104104
require.True(t, ok)
105105
require.Len(t, i.Entities, 1)
106106
require.Equal(t, i.Entities[0].Name(), entityNamePrefix+":"+hostName+":"+serviceName)
107+
require.False(t, i.Entities[0].IgnoreEntity)
107108
}
108109

109110
func TestNoServiceNameAllowed(t *testing.T) {

src/winservices.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ type hostnameFn func() (name string, err error)
4444
func main() {
4545
i, err := integration.New(integrationName, integrationVersion, integration.Args(&args))
4646
fatalOnErr(err)
47+
// We want the hostEntity to be created because it's needed for the register_batch endpoint
48+
i.HostEntity.SetIgnoreEntity(false)
49+
4750
log.SetupLogging(args.Verbose)
4851

4952
v := fmt.Sprintf("integration version: %s commit: %s", integrationVersion, commitHash)

0 commit comments

Comments
 (0)