Buscar pacotes, repositórios e categorias de apps

Detalhes do pacotev0.18.11+1

opentelemetry

Um framework para coletar rastreamentos do OpenTelemetry a partir de aplicativos.

Web
Downloads em 30 dias
260 mil
Curtidas
47
Pontos Pub
140

Instalar pacote

flutter pub add opentelemetry

Visão geral do pacote

Orientação gerada a partir de informações públicas. Apenas para referência.

Um pacote Flutter/Dart que permite aos aplicativos coletar e exportar rastreamentos OpenTelemetry para observabilidade. Ele se integra perfeitamente às plataformas web, fornecendo uma forma padronizada de instrumentar o código e coletar métricas de desempenho, dados de latência e rastreamentos distribuídos. O pacote suporta rastreamento entre serviços e ajuda os desenvolvedores a depurar problemas ao oferecer insights detalhados sobre o comportamento do aplicativo. É projetado para uso em ambientes de produção onde monitoramento e diagnóstico são críticos.

Casos de uso

  • Monitoramento do desempenho do aplicativo
  • Rastreamento distribuído entre microsserviços
  • Depuração de problemas de latência
  • Observabilidade em tempo real em aplicativos web
  • Integração com backends do OpenTelemetry

Principais recursos

  • Suporte à plataforma Web
  • Instrumentação padronizada do OpenTelemetry
  • Coleta e exportação de rastreamento
  • Design leve e modular
  • Compatibilidade com o ecossistema OpenTelemetry

Indicado para

  • Desenvolvedores integrando observabilidade em aplicativos web
  • Equipes usando OpenTelemetry para monitoramento
  • Aplicações que exigem rastreamento distribuído
  • Integração de serviço backend
  • Depuração de produção

Considerações

  • Requer coletor de OpenTelemetry backend
  • Limitado à plataforma da web
  • Configuração adicional para propagação de rastreamento
  • Pode aumentar levemente o tamanho do pacote do aplicativo
  • Dependente de infraestrutura externa de telemetria

README original

Snapshot do README original do repositório-fonte vinculado. Consulte o repositório para o conteúdo mais recente.

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

Categorias

Dependências

Lista de dependências 1 itens

Repositório-fonte

Projetos que usam este pacote

Rankings