Code Monkey home page Code Monkey logo

otel-examples's Introduction

Otel in js

open-telemetry/opentelemetry-js: OpenTelemetry JavaScript Client

6-pieces

otel-layer

Otel Layer in js

  • API
    • Core(Semantic Conversions) / API
  • SDK
    • node: server application, automatic
    • web: web application, automatic
    • tracing: server/web, manually
    • metric
    • exporter: otel exporter
  • Collector
    • 여러 vendor의 데이터를 수신하고 처리 및 내보내는 pipeline 제공
    • zipkin, jaeger, prometheus, otlp
  • Plugins
    • node(server)/node의 core, 각 벤더별(express, redis, mysql)로 tracing을 자동화로 수집할 수 있는 plugin 제공

Otel JS Packages

API

Package Description
@opentelemetry/api This package provides TypeScript interfaces, enums and no-op implementations for the OpenTelemetry core trace and metrics model.
It is intended for use both on the server and in the browser.
OpenTelemetry 코어 트레이싱 및 메트릭 모델에 대한 Typescript 인터페이스, enum 및 no-op 구현을 제공
@opentelemetry/core This package provides default and no-op implementations of the OpenTelemetry api for trace and metrics.
It's intended for use both on the server and in the browser.
트레이싱 및 메트릭에 대한 OpentElemetry API의 기본 및 NO-OP 구현을 제공

Implementation / SDKs

Package Description
@opentelemetry/tracing This module provides a full control over instrumentation and span creation.
It doesn't load async_hooks or any instrumentation plugin by default.
It is intended for use both on the server and in the browser.
계측 및 스팬 생성을 완벽하게 제어 할 수 있다.
기본적으로 ASYNC_HOOKS 또는 모든 계측 플러그인을 로드하지 않는다.
@opentelemetry/metrics This module provides instruments and meters for reporting of time series data.
@opentelemetry/node This module provides automatic tracing for Node.js applications. It is intended for use on the server only.
Node 어플리케이션의 자동화된 트레이싱 제공
@opentelemetry/web This module provides automated instrumentation and tracing for Web applications. It is intended for use in the browser only.
웹 애플리케이션에 대한 자동화 된 계측 및 트레이싱 제공

Compatible Exporters

...

Instrumentations & Plugins

...


Otel Collector

https://github.com/open-telemetry/opentelemetry-collector

  • OpenTelemetry Collector는 원격분석 데이터(telemetry data)를 수신, 처리 및 내보내는 방법에 대해 vendor-agnostic한 구현을 제공한다.
  • 또한 여러 오픈 소스 또는 상용 백엔드로 보내는 오픈 소스 원격분석 데이터 형식(Jaeger, Prometheus..)을 지원하기 위해 여러 에이전트/콜렉터를 실행, 운영 및 유지 관리 할 필요가 없다.

Objectives:

  • Usable: Reasonable default configuration, supports popular protocols, runs and collects out of the box.
  • Performant: Highly stable and performant under varying loads and configurations.
  • Observable: An exemplar of an observable service.
  • Extensible: Customizable without touching the core code.
  • Unified: Single codebase, deployable as an agent or collector with support for traces, metrics and logs.

Otel Terminology

Open Telemetry

  • metric
  • trace
  • logs

Spans

Spans in OpenTelemetry | Lightstep's OpenTelemetry Docs

  • A span is the building block of a trace and is a named, timed operation that represents a piece of the workflow in the distributed system. Multiple spans are pieced together to create a trace.
  • 스팬은 trace 빌딩 블록이며 분산 시스템에서 워크 플로의 일부를 나타내는 시간 지정 작업이다. 여러 스팬이 함께 결합되어 트레이스를 생성한다.

Trace Context

W3C Trace Context

W3C Trace Context Level 1 W3C Trace Context Level 2

  • This specification defines standard HTTP headers and a value format to propagate context information that enables distributed tracing scenarios. The specification standardizes how context information is sent and modified between services. Context information uniquely identifies individual requests in a distributed system and also defines a means to add and propagate provider-specific context information.

  • 이 사양은 표준 HTTP 헤더와 값 형식을 정의하여 분산 트레이싱 시나리오를 사용하는 컨텍스트 정보를 전파한다. 사양은 컨텍스트 정보가 서비스간에 전송되고 수정되는 방법을 표준화한다. 컨텍스트 정보는 분산 시스템에서 개별 요청을 고유하게 식별하고 공급자 별 컨텍스트 정보를 추가하고 전파하는 수단을 정의한다.

  • w3c/trace-context's Goal

    • This specification defines formats to pass trace context information across systems. Our goal is to share this with the community so that various tracing and diagnostics products can operate together.
    • 이 사양은 시스템 전체에서 추적 컨텍스트 정보를 전달하는 형식을 정의합니다. 우리의 목표는 다양한 트레이스 및 진단 제품이 함께 작동 할 수 있도록 커뮤니티와 공유하는 것입니다.

lightstep Otel: Context Propagation

OpenTelemetry | Core Concepts: Context Propagation

서비스 경계를 넘어 이벤트를 연관시키는 기능은 분산 트레이싱의 기본 개념 중 하나이다. 이러한 기능을 구현하려면 분산 트레이싱 시스템의 구성 요소가 컨텍스트라고 하는 메타 데이터를 수집, 저장 및 전송할 수 있어야 한다. 컨텍스트는 현재 스팬 및 트레이스를 식별하는 정보를 가지고 있으며, 임의의 correlation을 키 값 쌍으로 포함 할 수 있다. Propagation은 종종 HTTP 헤더를 통해 컨텍스트가 서비스 안팎으로 번들되고 전송되는 수단이다.

  • context: 메타데이터, can be passed between functions in process or between processes over an RPC
  • 분산 트레이싱 시스템의 구성 요소는 컨텍스트라고 하는 메타 데이터를 수집, 저장 및 전송할 수 있어야 한다.
  • propagation: 전송 수단, 일반적으로 HTTP 헤더를 통해 전송

high-level look at the context propagation architecture in OpenTelemetry

Context
  • traces는 span들로 구성되며 span은 context(메타데이터)를 가지고 있다.
  • context는 span context, correlation context 두가지 타입이 있다.
  • baggage context => correlation context: 이전 버전과의 호환성
  • Span Context: 스팬 컨텍스트는 서비스 경계에서 트레이스 정보를 이동하는 데 필요한 데이터를 나타냅니다.
    • traceID: trace identifier
    • spanID: span identifier
    • traceFlags: trace options
    • traceState: trace state
  • Correlation Context: Correlation 컨텍스트는 사용자가 정의한 속성을 전달한다.
    • identifier
    • analysis
Propagation

Propagation은 서비스와 프로세스 간의 컨텍스트의 이동을 가능케하는 메커니즘이다.

OpenTelemetry가 인식하는 propagation에 관한 몇 가지 프로토콜이 있다.

Trace Context Reference

B3 Propagation

openzipkin/b3-propagation: Repository that describes and sometimes implements B3 propagation

otel-examples's People

Contributors

zestairlove avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.