Skip to content

Comments

feat: implement prometheus metrics for edgex devices (#1800)#2496

Open
SoumyaRaikwar wants to merge 5 commits intoopenyurtio:masterfrom
SoumyaRaikwar:feat/1800-prometheus-device-management
Open

feat: implement prometheus metrics for edgex devices (#1800)#2496
SoumyaRaikwar wants to merge 5 commits intoopenyurtio:masterfrom
SoumyaRaikwar:feat/1800-prometheus-device-management

Conversation

@SoumyaRaikwar
Copy link

What type of PR is this?

/kind feature
/sig iot

What this PR does / why we need it:

This PR implements a Prometheus-based metrics exporter for EdgeX devices managed by yurt-iot-dock. It addresses the lack of observability for EdgeX device status and resource usage.
Key changes include:

  • Metrics Client: Extended the EdgeX V3 device client to fetch metrics from Core Metadata and Core Command services.
  • Prometheus Exporter: Implemented a custom EdgeXCollector in yurt-iot-dock that scrapes these metrics and exposes them via the standard controller metrics endpoint.
  • Integration: Wired the exporter into the yurt-iot-dock manager lifecycle.
    This allows users to monitor EdgeX components using standard Prometheus/Grafana stacks integrated with OpenYurt.

Which issue(s) this PR fixes:

Fixes #1800

Special notes for your reviewer:

The implementation reuses existing files (cmd/yurt-iot-dock/app/core.go and pkg/yurtiotdock/clients/edgex-foundry/v3/device_client.go) to keep the file footprint minimal, as requested during development.

Does this PR introduce a user-facing change?

Feature: Support Prometheus metrics collection for EdgeX devices in yurt-iot-dock.

Signed-off-by: SoumyaRaikwar <somuraik@gmail.com>
@SoumyaRaikwar SoumyaRaikwar requested a review from a team as a code owner January 17, 2026 22:01
@SoumyaRaikwar
Copy link
Author

@charleszheng44 This PR implements a Prometheus-based metrics exporter for EdgeX devices managed by yurt-iot-dock. It addresses the lack of observability for EdgeX device status and resource usage. could you take a look

@codecov
Copy link

codecov bot commented Jan 19, 2026

Codecov Report

❌ Patch coverage is 65.43210% with 28 lines in your changes missing coverage. Please review.
✅ Project coverage is 44.20%. Comparing base (d32d27f) to head (6606704).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
cmd/yurt-iot-dock/app/core.go 59.18% 19 Missing and 1 partial ⚠️
...g/yurtiotdock/clients/edgex-foundry/edgexobject.go 0.00% 6 Missing ⚠️
...tiotdock/clients/edgex-foundry/v3/device_client.go 92.30% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2496      +/-   ##
==========================================
+ Coverage   43.88%   44.20%   +0.31%     
==========================================
  Files         399      399              
  Lines       26560    26606      +46     
==========================================
+ Hits        11657    11761     +104     
+ Misses      13843    13780      -63     
- Partials     1060     1065       +5     
Flag Coverage Δ
unittests 44.20% <65.43%> (+0.31%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@zyjhtangtang
Copy link

@SoumyaRaikwar Please focus on the blocking issues in the code detection.

Signed-off-by: SoumyaRaikwar <somuraik@gmail.com>
@SoumyaRaikwar
Copy link
Author

@SoumyaRaikwar Please focus on the blocking issues in the code detection.

@zyjhtangtang done addressed the blocking issues in latest updatte

Signed-off-by: SoumyaRaikwar <somuraik@gmail.com>
Signed-off-by: SoumyaRaikwar <somuraik@gmail.com>
Signed-off-by: SoumyaRaikwar <somuraik@gmail.com>
@sonarqubecloud
Copy link

@SoumyaRaikwar
Copy link
Author

@zyjhtangtang @rambohe-ch, could you please review this pr

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.

[feature request] Prometheus-based solution for device management

2 participants