OTelCollector
- class duetector.collectors.otel.OTelInitiator(*args, **kwargs)[source]
Bases:
objectHost the OpenTelemetry SDK and initialize the provider and exporter.
- Avaliable exporters:
consoleotlp-grpcotlp-httpjaeger-thriftjaeger-grpczipkin-httpzipkin-jsonprometheus
Example:
otel = OTelInitiator() trace = otel.initialize( service_name="duetector", exporter="console", ) from opentelemetry import trace tracer = trace.get_tracer(__name__) with tracer.start_as_current_span("test") as span: span.set_attribute("test", "test") otel.shutdown()
- exporter_cls = {'console': <class 'opentelemetry.sdk.trace.export.ConsoleSpanExporter'>, 'jaeger-grpc': <class 'opentelemetry.exporter.jaeger.proto.grpc.JaegerExporter'>, 'jaeger-thrift': <class 'opentelemetry.exporter.jaeger.thrift.JaegerExporter'>, 'otlp-grpc': <class 'opentelemetry.exporter.otlp.proto.grpc.trace_exporter.OTLPSpanExporter'>, 'otlp-http': <class 'opentelemetry.exporter.otlp.proto.http.trace_exporter.OTLPSpanExporter'>, 'zipkin-http': <class 'opentelemetry.exporter.zipkin.proto.http.ZipkinExporter'>, 'zipkin-json': <class 'opentelemetry.exporter.zipkin.json.ZipkinExporter'>}
- class duetector.collectors.otel.OTelCollector(config: dict[str, Any] | None = None, *args, **kwargs)[source]
Bases:
Collector,OTelInspectorA collector using OpenTelemetry SDK.
- Config:
exporter: One ofconsole,otlp-grpc,otlp-http,jaeger-thrift,jaeger-grpc,zipkin-http,zipkin-json, seeOTelInitiatorfor more detailsexporter_kwargs: A dict of kwargs for exporter
Note
Since v1.35, the Jaeger supports OTLP natively. Please use the OTLP exporter instead. Support for this exporter will end July 2023.
- default_config = {'backend_args': {'max_workers': 10}, 'disabled': True, 'exporter': 'console', 'exporter_kwargs': {}, 'grpc_exporter_kwargs': {'certificate_chain_path': '', 'private_key_path': '', 'root_certificates_path': '', 'secure': False}, 'processor_kwargs': {}, 'statis_id': ''}
Default config for
Collector
- property endpoint: str | None
- property exporter: str
- property exporter_kwargs: dict[str, Any]
- property grpc_exporter_kwargs: dict[str, Any]
- property processor_kwargs: dict[str, Any]
- property service_name: str
- service_prefix = 'duetector'
- service_sep = '-'