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

[host-metrics] adapt default meter name to be the npm package name #1782

Closed
pichlermarc opened this issue Nov 9, 2023 · 0 comments · Fixed by #1822 or #1829
Closed

[host-metrics] adapt default meter name to be the npm package name #1782

pichlermarc opened this issue Nov 9, 2023 · 0 comments · Fixed by #1822 or #1829
Assignees
Labels
enhancement New feature or request pkg:host-metrics up-for-grabs Good for taking. Extra help will be provided by maintainers

Comments

@pichlermarc
Copy link
Member

Currently the host-metrics package does not use the npm package name as the meter name. I think we should align this with other instrumentations and also use the npm package name for this instrumentation.


I agree that the npm package name makes more sense for Node. Yes, it looks like most of the instrumentations use their package name.

The host-metrics package differs slightly FWIW, using 'opentelemetry-host-metrics':

const DEFAULT_NAME = 'opentelemetry-host-metrics';
/**
* Base Class for metrics
*/
export abstract class BaseMetrics {
protected _logger = api.diag;
protected _meter: api.Meter;
private _name: string;
constructor(config: MetricsCollectorConfig) {
this._name = config.name || DEFAULT_NAME;
const meterProvider =
config.meterProvider! || api.metrics.getMeterProvider();
if (!config.meterProvider) {
this._logger.warn('No meter provider, using default');
}
this._meter = meterProvider.getMeter(this._name, VERSION);

Originally posted by @trentm in #1713 (comment)

@pichlermarc pichlermarc added pkg:host-metrics enhancement New feature or request up-for-grabs Good for taking. Extra help will be provided by maintainers labels Nov 9, 2023
@trentm trentm self-assigned this Nov 23, 2023
trentm added a commit to trentm/opentelemetry-js-contrib that referenced this issue Nov 23, 2023
trentm added a commit that referenced this issue Dec 7, 2023
…ion scope name, to align with instrumentations (#1822)

Closes: #1782
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pkg:host-metrics up-for-grabs Good for taking. Extra help will be provided by maintainers
Projects
None yet
2 participants