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

fix(host-metrics): semcov alignment & macOS fix #2071

Open
wants to merge 35 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
2c6d8cf
fix: semcov alignment & reduce import bundle
Netail Mar 29, 2024
60e0933
fix: types?
Netail Apr 2, 2024
65aabe7
Merge branch 'main' into fix/host-metrics-bundling
Netail Apr 2, 2024
ae578fc
fix: ci/cd
Netail Apr 2, 2024
ce92ffe
Merge branch 'main' into fix/host-metrics-bundling
Netail Apr 2, 2024
e818ba5
Merge branch 'main' into fix/host-metrics-bundling
Netail Apr 3, 2024
2484ef6
Merge branch 'main' into fix/host-metrics-bundling
Netail Apr 4, 2024
1106e97
docs: specify semantic conventions
Netail Apr 4, 2024
8f65520
revert some changes
Netail Apr 5, 2024
08506a4
Merge branch 'main' into fix/host-metrics-bundling
Netail Apr 8, 2024
63cc39d
fix: small type improvement
Netail Apr 9, 2024
03e2237
docs: add small comment
Netail Apr 9, 2024
9cbe462
Merge branch 'main' into fix/host-metrics-bundling
Netail Apr 10, 2024
a2aaa4b
Merge branch 'main' into fix/host-metrics-bundling
Netail Apr 11, 2024
744ea1d
fix: feedback
Netail Apr 16, 2024
cc8aafe
Merge branch 'main' into fix/host-metrics-bundling
Netail Apr 16, 2024
d1c1fca
Merge branch 'main' into fix/host-metrics-bundling
Netail Apr 18, 2024
a3b898f
Merge branch 'main' into fix/host-metrics-bundling
Netail Apr 20, 2024
a8196e4
fix: feedback
Netail Apr 20, 2024
304dc98
Merge branch 'main' into fix/host-metrics-bundling
Netail Apr 24, 2024
9f81a2d
Merge branch 'main' into fix/host-metrics-bundling
Netail Apr 27, 2024
769de9e
Merge branch 'main' into fix/host-metrics-bundling
Netail Apr 29, 2024
4fd1f8f
Merge branch 'main' into fix/host-metrics-bundling
Netail Apr 29, 2024
9c30315
Merge branch 'main' into fix/host-metrics-bundling
Netail Apr 30, 2024
83c58a3
Merge branch 'main' into fix/host-metrics-bundling
Netail May 1, 2024
2ac772e
Merge branch 'main' into fix/host-metrics-bundling
Netail May 2, 2024
343733e
Merge branch 'main' into fix/host-metrics-bundling
Netail May 3, 2024
fd50fe5
Merge branch 'main' into fix/host-metrics-bundling
Netail May 5, 2024
38b80b1
Merge branch 'main' into fix/host-metrics-bundling
Netail May 7, 2024
b642766
Merge branch 'main' into fix/host-metrics-bundling
Netail May 8, 2024
5e6370a
Merge branch 'main' into fix/host-metrics-bundling
Netail May 17, 2024
deb3257
Merge branch 'main' into fix/host-metrics-bundling
Netail May 21, 2024
5922334
fix: feedback
Netail May 22, 2024
06ac5e7
Merge branch 'main' into fix/host-metrics-bundling
Netail May 22, 2024
a3f9a61
Merge branch 'main' into fix/host-metrics-bundling
Netail May 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 1 addition & 3 deletions packages/opentelemetry-host-metrics/src/enum.ts
Expand Up @@ -34,9 +34,7 @@ export enum ATTRIBUTE_NAMES {
SYSTEM_DEVICE = 'system.device',
SYSTEM_NETWORK_DIRECTION = 'system.network.direction',
SYSTEM_NETWORK_STATE = 'system.network.state',
// TODO: change value if semconv changes
// https://github.com/open-telemetry/opentelemetry-specification/issues/3776
PROCESS_CPU_STATE = 'state',
PROCESS_CPU_STATE = 'process.cpu.state',
}

export enum CPU_LABELS {
Expand Down
4 changes: 2 additions & 2 deletions packages/opentelemetry-host-metrics/src/stats/si.ts
Expand Up @@ -14,12 +14,12 @@
* limitations under the License.
*/

import * as SI from 'systeminformation';
import { networkStats } from 'systeminformation/lib/network';
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure about systeminformation but deep-imports like this are usually not covered by stability guarantees. would this work for you?

Suggested change
import { networkStats } from 'systeminformation/lib/network';
import { networkStats } from 'systeminformation';

Copy link
Author

@Netail Netail Apr 9, 2024

Choose a reason for hiding this comment

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

@pichlermarc Sadly not, it still imports the /lib/cpu file for some reason. Resulting in having to add the unnecessary dependency osx-temperature-sensor, which is not even used by networkStats()

Copy link
Contributor

Choose a reason for hiding this comment

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

Resulting in having to add the unnecessary dependency osx-temperature-sensor,

Why "having to add"? It looks like lib/cpu.js lazily does require('osx-temperature-sensor') only if cpuTemperature() is called.

import { NetworkData } from '../types';

export function getNetworkData() {
return new Promise<NetworkData[]>(resolve => {
SI.networkStats()
networkStats()
.then(resolve)
.catch(() => {
resolve([]);
Expand Down