パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v0.18.11

opentelemetry_wk

アプリケーションから OpenTelemetry トレースを収集するためのフレームワーク。

Web
30日間ダウンロード
5万
いいね数
2
Pub ポイント
145

パッケージをインストール

flutter pub add opentelemetry_wk

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

opentelemetry_wk は、アプリケーションから OpenTelemetry トレースを収集するように設計された Flutter/Dart パッケージであり、パフォーマンスおよび動作の詳細な観測性を実現します。Workiva によって開発され、Web プラットフォームをサポートし、OpenTelemetry エコシステムと統合されており、標準化されたテレメトリデータ収集が可能です。このパッケージを使用することで、開発者はアプリにインストルメンテーションを追加し、スパン、メトリクス、ログをキャプチャできるようになり、分散システムにおけるデバッグ、モニタリング、分析を容易にします。特に、観測性基準への準拠が求められる環境で有用です。ソースコードは GitHub で公開されており、透明性と貢献を促進しています。

用途

  • アプリケーションパフォーマンス監視
  • Web アプリケーションにおける分散トレーシング
  • レイテンシの問題のデバッグ
  • 観測性基準への準拠
  • バックエンドテレメトリー システムとの統合

主な機能

  • Web プラットフォームのサポート
  • OpenTelemetry 標準準拠
  • スパンの収集と伝播
  • OpenTelemetry エクスポートャーとの統合
  • 軽量で拡張可能な設計

適している対象

  • WebベースのFlutterアプリケーション
  • OpenTelemetry を使用するチーム
  • 観測性のインサイトが必要な開発者
  • バックエンド統合型のモニタリングワークフロー
  • リアルタイムアプリケーション診断

注意事項

  • Webプラットフォームに限定
  • エクスポート用の追加設定が必要です
  • ネイティブモバイルサポートなし
  • OpenTelemetry バックエンドインフラストラクチャに依存
  • OpenTelemetry コンセプトの学習曲線

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

OpenTelemetry for Dart

This repository is the Dart implementation of the OpenTelemetry project. All contributions and designs should follow the OpenTelemetry specification.

Project Status

Signal Status
Traces Beta
Metrics Alpha
Logs Unimplemented

Getting Started

This section will show you how to initialize the OpenTelemetry SDK, capture a span, and propagate context.

Initialize the OpenTelemetry SDK
import 'package:opentelemetry/sdk.dart'
    show
        BatchSpanProcessor,
        CollectorExporter,
        ConsoleExporter,
        SimpleSpanProcessor,
        TracerProviderBase;
import 'package:opentelemetry/api.dart'
    show registerGlobalTracerProvider, globalTracerProvider;

void main(List<String> args) {
  final tracerProvider = TracerProviderBase(processors: [
    BatchSpanProcessor(
        CollectorExporter(Uri.parse('https://my-collector.com/v1/traces'))),
    SimpleSpanProcessor(ConsoleExporter())
  ]);

  registerGlobalTracerProvider(tracerProvider);
  final tracer = globalTracerProvider.getTracer('instrumentation-name');
}
Capture a Span
import 'package:opentelemetry/api.dart' show StatusCode, globalTracerProvider;

void main(List<String> args) {
  final tracer = globalTracerProvider.getTracer('instrumentation-name');

  final span = tracer.startSpan('main');
  try {
    // do some work
    span.addEvent('some work');
  } catch (e, s) {
    span
      ..setStatus(StatusCode.error, e.toString())
      ..recordException(e, stackTrace: s);
    rethrow;
  } finally {
    span.end();
  }
}
Propagate Context
Intra-process

In order to parent spans, context must be propagated. Propagation can be achieved by manually passing an instance of Context or by using Dart Zones.

See the attach detach context examplefor more information.

Inter-process

In order to parent spans between processes, context can be serialized and deserialized using a TextMapPropagator, TextMapSetter, and TextMapGetter.

See the W3C context propagation example for more information.

High Resolution Timestamps

A tracer provider can register a web-specific time provider that uses the browser's performance API instead of DateTime when recording timestamps for a span's start timestamp, end timestamp, and span events.

import 'package:opentelemetry/web_sdk.dart' as web_sdk;

final tracerProvider =
    web_sdk.WebTracerProvider(timeProvider: web_sdk.WebTimeProvider());

Important Note: Span timestamps may be inaccurate if the executing system is suspended for sleep. See https://github.com/open-telemetry/opentelemetry-js/issues/852 for more information.

Contributing

In order to generate protobuf definitions, you must have protoc installed and available in your path.

Publishing New Versions

Only Workiva maintainers can publish new versions of opentelemetry-dart. See Publishing opentelemetry-dart

カテゴリー

依存関係

依存関係一覧 9 件

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。

ランキング