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

More Data added to OHI Inventory #2007

Conversation

rahulreddy15
Copy link
Contributor

integrationVersion, integrationName, reportingAgent added to inventory
custom_attributes from infra agent config are added with prefix labels/
labels from ohi config file are added with prefix labels/

@rahulreddy15 rahulreddy15 requested a review from a team as a code owner January 24, 2025 14:12
@coveralls
Copy link

coveralls commented Jan 24, 2025

Pull Request Test Coverage Report for Build 13193786760

Details

  • 30 of 30 (100.0%) changed or added relevant lines in 4 files are covered.
  • 4 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.05%) to 57.401%

Files with Coverage Reduction New Missed Lines %
pkg/config/config.go 2 70.63%
pkg/backend/telemetryapi/harvester.go 2 87.62%
Totals Coverage Status
Change from base Build 13136202138: 0.05%
Covered Lines: 15399
Relevant Lines: 26827

💛 - Coveralls

@rahulreddy15 rahulreddy15 marked this pull request as draft February 4, 2025 11:25
@rahulreddy15 rahulreddy15 force-pushed the NR-358858-Infra-Agent-add-additional-OHI-details-into-the-inventory branch from 2f53613 to 0c44e3b Compare February 5, 2025 06:43
@rahulreddy15 rahulreddy15 marked this pull request as ready for review February 5, 2025 09:08
Comment on lines 704 to 708
if expectedValue, exists := expectedLabelValues[id]; exists {
c.Assert(value, Equals, expectedValue)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a fail if it doesn't exist?

if expectedValue, exists := expectedLabelValues[id]; exists {
  c.Assert(value, Equals, expectedValue)
} else {
  c.Fail()
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test now fails when label is not found.

Comment on lines 1621 to 1627
if expectedValue, exists := expectedLabelValues[id]; exists {
assert.EqualValues(t, value, expectedValue)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add an assertion to fail if expectedValue doesn't exist

if expectedValue, exists := expectedLabelValues[id]; exists {
  assert.EqualValues(t, value, expectedValue)
} else {
  t.Fail()
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test now fails when label is not found.

Comment on lines 1644 to 1653
if expectedValue, exists := expectedLabelValues[id]; exists {
assert.EqualValues(t, value, expectedValue)
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above:

if expectedValue, exists := expectedLabelValues[id]; exists {
  assert.EqualValues(t, value, expectedValue)
} else {
  t.Fail()
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test now fails when label is not found.

Copy link
Contributor

@rubenruizdegauna rubenruizdegauna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

integrationVersion, integrationName, reportingAgent added
custom attributes from infra agent config are added with prefix labels/
labels from ohi config file are added with prefix labels/
@rahulreddy15 rahulreddy15 force-pushed the NR-358858-Infra-Agent-add-additional-OHI-details-into-the-inventory branch from 8775e7f to 116b27d Compare February 7, 2025 05:24
@rahulreddy15 rahulreddy15 merged commit 1366f44 into master Feb 7, 2025
24 checks passed
@rahulreddy15 rahulreddy15 deleted the NR-358858-Infra-Agent-add-additional-OHI-details-into-the-inventory branch February 7, 2025 05:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants