logologo
Get Started
Guide
Development
Plugins
API
Home
English
简体中文
日本語
한국어
Español
Português
Deutsch
Français
Русский
Italiano
Türkçe
Українська
Tiếng Việt
Bahasa Indonesia
ไทย
Polski
Nederlands
Čeština
العربية
עברית
हिन्दी
Svenska
Get Started
Guide
Development
Plugins
API
Home
logologo
API Overview

@nocobase/auth

AuthManager
Auth
BaseAuth

@nocobase/cli

NocoBase CLI
Global Environment Variables

@nocobase/client

Application
Plugin

@nocobase/database

Collection
Field

interfaces

BaseInterface
Filter Operators

RelationRepository

BelongsToManyRepository
belongs-to-repository
HasManyRepository
HasOneRepository
Repository

shared

create-options
destroy-options
find-one
find-options
transaction
update-options

@nocobase/flow-engine

DataSourceManager
FlowContext
FlowEngine
FlowModel
FlowResource

@nocobase/server

AppCommand
Application
AuditManager
Context
Migration
Plugin

@nocobase/sdk

Auth
Storage

@nocobase/telemetry

Metric
Telemetry
Trace
Previous PageStorage
Next PageTelemetry

#Metric

#Class Methods

#constructor()

Constructor to create a Metric instance.

#Signature

  • constructor(options?: MetricOptions)

#Type

export type MetricOptions = {
  meterName?: string;
  version?: string;
  readerName?: string | string[];
};

#Details

PropertyTypeDescriptionDefault Value
meterNamestringMeter identifiernocobase-meter
versionstringCurrent version of NocoBase
readerNamestring | string[]Identifier(s) of registered MetricReader to use-

#init()

Initializes MetricProvider.

#Signature

  • init(): void

#registerReader()

Registers a MetricReader.

#Signature

  • registerReader(name: string, reader: GetMetricReader)

#Type

import { MetricReader } from '@opentelemetry/sdk-metrics';

type GetMetricReader = () => MetricReader;

#Details

ParameterTypeDescription
namestringUnique identifier for MetricReader
reader() => MetricReaderFunction to get MetricReader

#addView()

Adds a View. Refer to Configure Metric Views.

#Signature

  • addView(...view: View[])

#Type

import { View } from '@opentelemetry/sdk-metrics';

#getMeter()

Gets the Meter.

#Signature

  • getMeter(name?: string, version?: string)

#Details

ParameterTypeDescriptionDefault Value
namestringMeter identifiernocobase-meter
versionstringCurrent version of NocoBase

#start()

Starts the MetricReader.

#Signature

  • start(): void

#shutdown()

Stops the MetricReader.

#Signature

  • shutdown(): Promise<void>