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

Bump prom-client from 14.1.0 to 14.2.0 #5236

Merged
merged 2 commits into from
Mar 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/beacon-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
"it-pipe": "^2.0.5",
"jwt-simple": "0.5.6",
"libp2p": "0.42.2",
"prom-client": "^14.1.0",
"prom-client": "^14.2.0",
"prometheus-gc-stats": "^0.6.3",
"snappyjs": "^0.7.0",
"stream-to-it": "^0.2.0",
Expand Down
8 changes: 4 additions & 4 deletions packages/beacon-node/src/monitoring/properties.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Registry} from "prom-client";
import {JsonRecord, JsonType, MetricObject, MetricValue, MetricWithGetter, RecordValue} from "./types.js";
import {MetricObjectWithValues, MetricValue as MetricValueObject, Registry} from "prom-client";
import {JsonRecord, JsonType, MetricValue, RecordValue} from "./types.js";

type PropertyDefinition = {
/** Key of value to be sent to remote service */
Expand Down Expand Up @@ -86,7 +86,7 @@ export class MetricProperty<T extends RecordValue> implements ClientStatsPropert
const metric = register.getSingleMetric(this.definition.metricName);

if (metric) {
const metricObject = await (metric as MetricWithGetter).get();
const metricObject = await metric.get();

const metricValue = this.extractMetricValue(metricObject);

Expand All @@ -106,7 +106,7 @@ export class MetricProperty<T extends RecordValue> implements ClientStatsPropert
return {key: this.definition.jsonKey, value: this.definition.defaultValue};
}

private extractMetricValue(metricObject: MetricObject): MetricValue | undefined {
private extractMetricValue(metricObject: MetricObjectWithValues<MetricValueObject<string>>): MetricValue | undefined {
const {withLabel, fromLabel} = this.definition;

if (withLabel) {
Expand Down
11 changes: 0 additions & 11 deletions packages/beacon-node/src/monitoring/types.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
import {Metric} from "prom-client";
import {ClientStatsProperty} from "./properties.js";

// get methods are missing in prom-client type definitions
// see https://github.com/siimon/prom-client/pull/531
export type MetricWithGetter = Metric & {
get(): Promise<MetricObject>;
};

export type MetricObject = {
values: Array<{value: number; labels: Record<string, string>}>;
};

export type MetricValue = string | number;

export type RecordValue = string | number | boolean;
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"js-yaml": "^3.14.0",
"lockfile": "^1.0.4",
"lodash": "^4.17.15",
"prom-client": "^14.1.0",
"prom-client": "^14.2.0",
"rimraf": "^3.0.0",
"source-map-support": "^0.5.19",
"uint8arrays": "^3.1.0",
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10792,10 +10792,10 @@ progress@^2.0.3:
resolved "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz"
integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==

prom-client@^14.1.0:
version "14.1.0"
resolved "https://registry.yarnpkg.com/prom-client/-/prom-client-14.1.0.tgz#049609859483d900844924df740722c76ed1fdbb"
integrity sha512-iFWCchQmi4170omLpFXbzz62SQTmPhtBL35v0qGEVRHKcqIeiexaoYeP0vfZTujxEq3tA87iqOdRbC9svS1B9A==
prom-client@^14.2.0:
version "14.2.0"
resolved "https://registry.yarnpkg.com/prom-client/-/prom-client-14.2.0.tgz#ca94504e64156f6506574c25fb1c34df7812cf11"
integrity sha512-sF308EhTenb/pDRPakm+WgiN+VdM/T1RaHj1x+MvAuT8UiQP8JmOEbxVqtkbfR4LrvOg5n7ic01kRBDGXjYikA==
dependencies:
tdigest "^0.1.1"

Expand Down