Skip to main content

Function: getMeter()

@arolariu/website


@arolariu/website / instrumentation.server / getMeter

Function: getMeter()

getMeter(name?): Meter

Defined in: instrumentation.server.ts:944

Get a meter instance for recording metrics.

Meters are used to create metric instruments (counters, histograms, etc.) that record quantitative measurements about application behavior.

Parameters​

name?​

string = "arolariu-website"

Meter name, typically the service or library name. Defaults to "arolariu-website"

Returns​

Meter

Meter instance for creating metric instruments

Remarks​

  • Meter names should follow semantic conventions
  • Use the same meter name consistently within a module or service
  • Meter instances are cached by the OpenTelemetry API

Example​

const meter = getMeter('my-service');
const counter = meter.createCounter('requests.total');
counter.add(1, { method: 'GET' });

See​

https://opentelemetry.io/docs/specs/otel/metrics/api/#meter

// was this page useful?