Skip to content

Commit

Permalink
Merge pull request #43 from newrelic/adias/fix-entity-reported-name
Browse files Browse the repository at this point in the history
fix: sql instance entity name was being reported incorrectly
  • Loading branch information
ardias committed Jul 29, 2020
2 parents bdf386a + 3e64114 commit 72c87d1
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## 2.5.1 (2020-07-29)
### Fixed
- MSSQL instances were being reported with only the host name instead of the full instance name

## 2.5.0 (2020-07-13)
### Changed
- Updated the MSSQL driver
Expand Down
2 changes: 1 addition & 1 deletion src/instance/sql_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func CreateInstanceEntity(i *integration.Integration, con *connection.SQLConnect

if instanceRows[0].Name.Valid {
instanceNameIDAttr := integration.NewIDAttribute("instance", instanceRows[0].Name.String)
return i.EntityReportedVia(con.Host, con.Host, "ms-instance", instanceNameIDAttr)
return i.EntityReportedVia(con.Host, instanceRows[0].Name.String, "ms-instance", instanceNameIDAttr)
}

return i.EntityReportedVia(con.Host, con.Host, "ms-instance")
Expand Down
2 changes: 1 addition & 1 deletion src/instance/sql_instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func Test_createInstanceEntity(t *testing.T) {
entity, err := CreateInstanceEntity(i, conn)
assert.Nil(t, err)

assert.Equal(t, "testhost", entity.Metadata.Name)
assert.Equal(t, "testinstance", entity.Metadata.Name)
assert.Equal(t, "ms-instance", entity.Metadata.Namespace)
assert.Len(t, entity.Metadata.IDAttrs, 1)
}
Expand Down
2 changes: 1 addition & 1 deletion src/mssql.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (

const (
integrationName = "com.newrelic.mssql"
integrationVersion = "2.5.0"
integrationVersion = "2.5.1"
)

func main() {
Expand Down

0 comments on commit 72c87d1

Please sign in to comment.