-
Notifications
You must be signed in to change notification settings - Fork 532
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
feat(instrumentation-runtime-node)!: add prom-client-metrics #2136
Merged
david-luna
merged 38 commits into
open-telemetry:main
from
pikalovArtemN:feat/node/prom-client-implementation
Nov 5, 2024
Merged
Changes from 36 commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
ed6596f
feat(prom-client) add implementation for collecting event loop lag, g…
pikalovArtemN 046072e
test(prom-client) add tests for check implementation
pikalovArtemN d7c5108
chore(prom-client) change version and fix README.md
pikalovArtemN ad88f98
Merge branch 'main' into feat/node/prom-client-implementation
pikalovArtemN 2cd9093
chore(instrumentation-runtime-node): fetch loop lag format in convention
pikalovArtemN 184b212
chore(instrumentation-runtime-node): fetch other metrics to convention
pikalovArtemN 922d677
test(instrumentation-runtime-node):fix some tests
pikalovArtemN 3cba596
chore(instrumentation-runtime-node): sync with conventions
pikalovArtemN 54858de
test(instrumentation-runtime-node): fix tests
pikalovArtemN 926f052
test(instrumentation-runtime-node): fix tests
pikalovArtemN dbb34ff
lint(instrumentation-runtime-node): lint
pikalovArtemN ade0ab9
Merge remote-tracking branch 'origin/feat/node/prom-client-implementa…
pikalovArtemN 7a98bfd
Merge branch 'main' into feat/node/prom-client-implementation
pikalovArtemN 7418c78
chore(instrumentation-runtime-node): synchronize with convention
pikalovArtemN fdfea51
Merge remote-tracking branch 'origin/feat/node/prom-client-implementa…
pikalovArtemN 6a84254
chore(instrumentation-runtime-node): remove scrape interval, remove u…
pikalovArtemN 5efdd9d
chore(instrumentation-runtime-node): set default monitoringPrecision …
pikalovArtemN a69fc5c
chore(instrumentation-runtime-node): addnodejs.eventloop.time, fix tests
pikalovArtemN 2d31e98
Merge branch 'main' into feat/node/prom-client-implementation
pikalovArtemN 184be5e
chore(instrumentation-runtime-node): fix conflicts
pikalovArtemN 8bf14b5
chore(instrumentation-runtime-node): fix event loop utilization colle…
pikalovArtemN 5121a0b
chore(instrumentation-runtime-node): fix package.json
pikalovArtemN fd8d803
chore(instrumentation-runtime-node): fix conflicts
pikalovArtemN 6506489
chore(instrumentation-runtime-node): lint
pikalovArtemN 012f370
Merge branch 'main' into feat/node/prom-client-implementation
pikalovArtemN 247403e
chore(instrumentation-runtime-node): fix test
pikalovArtemN d99c458
Merge remote-tracking branch 'origin/feat/node/prom-client-implementa…
pikalovArtemN 43ba51c
Merge branch 'main' into feat/node/prom-client-implementation
pikalovArtemN 2189d51
Merge branch 'main' into feat/node/prom-client-implementation
david-luna 460003f
chore(instrumentation-runtime-node): fix package-lock.json
pikalovArtemN 310a2b2
Merge remote-tracking branch 'origin/feat/node/prom-client-implementa…
pikalovArtemN feb3f36
Merge branch 'main' into feat/node/prom-client-implementation
david-luna 6b5fc8b
chore(instrumentation-runtime-node): fix attributes names
pikalovArtemN 97d8d92
Merge remote-tracking branch 'origin/feat/node/prom-client-implementa…
pikalovArtemN cab7e6c
chore(instrumentation-runtime-node): merge main
pikalovArtemN b663012
chore(instrumentation-runtime-node): lint
pikalovArtemN a6a9e81
chore: add skip lint directive
david-luna 4941407
Merge branch 'main' into feat/node/prom-client-implementation
david-luna File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
plugins/node/instrumentation-runtime-node/src/consts/attributes.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
export const ATTR_V8JS_HEAP_SPACE_NAME = 'heap.space.name'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
import { Histogram } from 'perf_hooks'; | ||
|
||
declare module 'node:perf_hooks' { | ||
interface IntervalHistogram extends Histogram { | ||
/** | ||
* Enables the update interval timer. Returns `true` if the timer was | ||
* started, `false` if it was already started. | ||
* @since v11.10.0 | ||
*/ | ||
enable(): boolean; | ||
|
||
/** | ||
* Disables the update interval timer. Returns `true` if the timer was | ||
* stopped, `false` if it was already stopped. | ||
* @since v11.10.0 | ||
*/ | ||
disable(): boolean; | ||
|
||
count: number; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
plugins/node/instrumentation-runtime-node/src/metrics/baseCollector.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
import { MetricCollector } from '../types/metricCollector'; | ||
import { Meter } from '@opentelemetry/api'; | ||
import { RuntimeNodeInstrumentationConfig } from '../types'; | ||
|
||
export abstract class BaseCollector implements MetricCollector { | ||
protected _config: RuntimeNodeInstrumentationConfig = {}; | ||
|
||
protected namePrefix: string; | ||
|
||
protected constructor( | ||
config: RuntimeNodeInstrumentationConfig = {}, | ||
namePrefix: string | ||
) { | ||
this._config = config; | ||
this.namePrefix = namePrefix; | ||
} | ||
|
||
public disable(): void { | ||
this._config.enabled = false; | ||
this.internalDisable(); | ||
} | ||
|
||
public enable(): void { | ||
this._config.enabled = true; | ||
this.internalEnable(); | ||
} | ||
|
||
public abstract updateMetricInstruments(meter: Meter): void; | ||
|
||
protected abstract internalEnable(): void; | ||
|
||
protected abstract internalDisable(): void; | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor Q: It looks like the default is 10 ms (from lower down in this README). Should the example here show 10 rather than 5000?