@orderlycode/grafana-otlp-client
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

@orderlycode/grafana-otlp-client

환경변수

전체 SDK env

  • OTEL_SERVICE_NAME: 서비스명
  • OTEL_EXPORTER_OTLP_ENDPOINT: grpc otlp endpoint
  • OTEL_NO_DELAY: 환경변수가 존재하면, Export를 최대한 빨리 한다.
  • OTEL_SDK_DISABLED: disable

사용법

CLI

우선순위 때문에 CLI로 하는 것을 추천한다.

node -r @orderlycode/grafana-otlp-client app.js

Code

// 무조건 코드 실행 처음에 존재해야 함
import '@orderlycode/grafana-otlp-client'

로거는 winston를 쓰면 알아서 로그가 보고된다.

import winston from "winston";

export const logger = winston.createLogger({
  transports: [
    new winston.transports.Console(),
  ],
  format: winston.format.combine(
    winston.format.timestamp(),
    winston.format.errors({stack: true}),
    winston.format.splat(),
    winston.format.json()
  ),
});

Readme

Keywords

none

Package Sidebar

Install

npm i @orderlycode/grafana-otlp-client

Weekly Downloads

1

Version

0.1.1

License

ISC

Unpacked Size

9.46 kB

Total Files

14

Last publish

Collaborators

  • inithink