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

[receiver/nsxreceiver] Add NSX-T Metrics Receiver #9738

Merged
merged 55 commits into from
May 13, 2022

Conversation

schmikei
Copy link
Contributor

@schmikei schmikei commented May 4, 2022

Description:

This adds a new component the nsxreceiver outlined in #9568 🚀

This component will support just themetrics telemetry type and sources those metrics via the NSX Rest API.

Users will need permissions to read properties/statistics from the Nodes. The LPU I believe is needed is an “Auditor”

image

I have tested on NSX-T DataCenter 3.1.2 pretty extensively.

Decided not to use the library https://github.com/vmware/go-vmware-nsxt because it appears to be out of date with most structs only touched 5 years ago, because of this I just created API structs/imported structs that the Metric Collection requires.

Example Configuration

receivers:
  nsx:
    collection_interval: 10s
    endpoint: https://nsx.australia-southeast1.gve.goog
    username: admin
    password: password

exporters:
  file:
    path: "./content.json"

service:
  pipelines:
    metrics:
      receivers: [nsx]
      exporters: [file]

List of planned metrics/statistics grabbed from API

[
  "nsx.interface.packet.count",
  "nsx.interface.throughput",
  "nsx.node.cache.memory.usage",
  "nsx.node.memory.usage",
  "nsx.node.cpu.utilization",
  "nsx.node.disk.usage",
  "nsx.node.disk.utilization"
]

Link to tracking Issue: #9568

Testing:

Test Coverage

As of submission unit test coverage of 95.4:

opentelemetry-collector-contrib/receiver/nsxreceiver nsxreceiver-metrics via 🐹 v1.17
➜ go test ./... -cover
ok  	github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver	0.760s	coverage: 95.4% of statements
?   	github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver/internal/metadata	[no test files]
?   	github.com/open-telemetry/opentelemetry-collector-contrib/receiver/nsxreceiver/internal/model	[no test files]

Documentation:

README.md was added along with derived metadata.yaml documentation in documentation.md

receiver/nsxreceiver/README.md Outdated Show resolved Hide resolved
internal/components/receivers_test.go Outdated Show resolved Hide resolved
receiver/nsxreceiver/README.md Outdated Show resolved Hide resolved
receiver/nsxreceiver/scraper.go Outdated Show resolved Hide resolved
receiver/nsxreceiver/metadata.yaml Outdated Show resolved Hide resolved
@dashpole
Copy link
Contributor

dashpole commented May 9, 2022

Ah, great. I was wondering when this PR would land. I'll take a look soon

receiver/nsxtreceiver/README.md Outdated Show resolved Hide resolved
receiver/nsxtreceiver/metadata.yaml Outdated Show resolved Hide resolved
receiver/nsxtreceiver/metadata.yaml Outdated Show resolved Hide resolved
receiver/nsxtreceiver/scraper.go Outdated Show resolved Hide resolved
receiver/nsxtreceiver/scraper.go Outdated Show resolved Hide resolved
receiver/nsxtreceiver/scraper.go Outdated Show resolved Hide resolved
receiver/nsxtreceiver/client_mock_test.go Outdated Show resolved Hide resolved
receiver/nsxtreceiver/config.go Show resolved Hide resolved
receiver/nsxtreceiver/documentation.md Outdated Show resolved Hide resolved
receiver/nsxtreceiver/documentation.md Outdated Show resolved Hide resolved
receiver/nsxtreceiver/documentation.md Outdated Show resolved Hide resolved
receiver/nsxtreceiver/metadata.yaml Show resolved Hide resolved
receiver/nsxtreceiver/scraper_test.go Outdated Show resolved Hide resolved
receiver/nsxtreceiver/scraper.go Show resolved Hide resolved
@schmikei
Copy link
Contributor Author

Noticed same CI failures for windows-msi on a couple commits in main. Don't think its related to this PR

https://github.com/open-telemetry/opentelemetry-collector-contrib/runs/6394288555?check_suite_focus=true

Copy link
Member

@djaglowski djaglowski left a comment

Choose a reason for hiding this comment

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

Looks good, but a couple minor things need to be addressed.

receiver/nsxtreceiver/README.md Outdated Show resolved Hide resolved
receiver/nsxtreceiver/metadata.yaml Outdated Show resolved Hide resolved
receiver/nsxtreceiver/metadata.yaml Outdated Show resolved Hide resolved
@djaglowski djaglowski merged commit f3772b1 into open-telemetry:main May 13, 2022
kentquirk pushed a commit to McSick/opentelemetry-collector-contrib that referenced this pull request Jun 14, 2022
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.

5 participants