Skip to content

Commit

Permalink
src: fix type of collectDefaultMetrics.metricsList
Browse files Browse the repository at this point in the history
Fixes #583
  • Loading branch information
zbjornson committed Nov 25, 2023
1 parent 2ffd316 commit c171309
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ project adheres to [Semantic Versioning](http://semver.org/).

- remove unnecessary loop from `osMemoryHeapLinux`
- Improve performance of `hashObject` by using pre-sorted array of label names
- Fix type of `collectDefaultMetrics.metricsList`

### Added

Expand Down
19 changes: 8 additions & 11 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -750,20 +750,17 @@ export interface DefaultMetricsCollectorConfiguration<
labels?: Object;
}

/**
* Configure default metrics
* @param config Configuration object for default metrics collector
*/
export function collectDefaultMetrics<T extends RegistryContentType>(
config?: DefaultMetricsCollectorConfiguration<T>,
): void;

export interface defaultMetrics {
export const collectDefaultMetrics: {
/**
* All available default metrics
* Configure default metrics
* @param config Configuration object for default metrics collector
*/
<T extends RegistryContentType>(
config?: DefaultMetricsCollectorConfiguration<T>,
): void;
/** All available default metrics */
metricsList: string[];
}
};

/**
* Validate a metric name
Expand Down

0 comments on commit c171309

Please sign in to comment.