Skip to content

Commit fdcfd84

Browse files
hostmetrics: Adding process.uptime metric (#37492)
#### Description Adding new metric into hostmetric process scraper to track process uptime #### Link to tracking issue Fixes #36667 #### Testing Added tests to validate coverage. #### Documentation Added as part of mdatagen
1 parent bfe79f6 commit fdcfd84

File tree

16 files changed

+196
-10
lines changed

16 files changed

+196
-10
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: enhancement
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
7+
component: hostmetrics/process
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Added support for tracking process.uptime
11+
12+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13+
issues: [36667]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext:
19+
20+
# If your change doesn't affect end users or the exported elements of any package,
21+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
22+
# Optional: The change log or logs in which this entry should be included.
23+
# e.g. '[user]' or '[user, api]'
24+
# Include 'user' if the change is relevant to end users.
25+
# Include 'api' if there is a change to a library API.
26+
# Default: '[user]'
27+
change_logs: [user]

connector/datadogconnector/go.sum

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

exporter/datadogexporter/go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ require (
334334
github.com/spf13/pflag v1.0.5 // indirect
335335
github.com/stormcat24/protodep v0.1.8 // indirect
336336
github.com/stretchr/objx v0.5.2 // indirect
337+
github.com/tilinna/clock v1.1.0 // indirect
337338
github.com/tinylib/msgp v1.2.5 // indirect
338339
github.com/tklauser/go-sysconf v0.3.14 // indirect
339340
github.com/tklauser/numcpus v0.8.0 // indirect

exporter/datadogexporter/go.sum

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

exporter/datadogexporter/integrationtest/go.sum

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

receiver/hostmetricsreceiver/go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ require (
1212
github.com/prometheus/procfs v0.15.1
1313
github.com/shirou/gopsutil/v4 v4.24.12
1414
github.com/stretchr/testify v1.10.0
15+
github.com/tilinna/clock v1.1.0
1516
github.com/yusufpapurcu/wmi v1.2.4
1617
go.opentelemetry.io/collector/component v0.118.1-0.20250123125445-24f88da7b583
1718
go.opentelemetry.io/collector/component/componenttest v0.118.1-0.20250123125445-24f88da7b583

receiver/hostmetricsreceiver/go.sum

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

receiver/hostmetricsreceiver/internal/scraper/processscraper/documentation.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,14 @@ Process threads count.
172172
| ---- | ----------- | ---------- | ----------------------- | --------- |
173173
| {threads} | Sum | Int | Cumulative | false |
174174
175+
### process.uptime
176+
177+
The time the process has been running.
178+
179+
| Unit | Metric Type | Value Type |
180+
| ---- | ----------- | ---------- |
181+
| s | Gauge | Double |
182+
175183
## Resource Attributes
176184
177185
| Name | Description | Values | Enabled |

receiver/hostmetricsreceiver/internal/scraper/processscraper/internal/metadata/generated_config.go

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

receiver/hostmetricsreceiver/internal/scraper/processscraper/internal/metadata/generated_config_test.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)