This library allows to export tracing data to an OTLP collector.
UsageThe OTLP Span Exporter allows to export OpenTelemetry traces to the OTLP collector.
You can configure the exporter with the following environment variables:
from opentelemetry import trace from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter from opentelemetry.sdk.resources import Resource from opentelemetry.sdk.trace import TracerProvider from opentelemetry.sdk.trace.export import BatchSpanProcessor # Resource can be required for some backends, e.g. Jaeger # If resource wouldn't be set - traces wouldn't appears in Jaeger resource = Resource(attributes={ "service.name": "service" }) trace.set_tracer_provider(TracerProvider(resource=resource)) tracer = trace.get_tracer(__name__) otlp_exporter = OTLPSpanExporter() span_processor = BatchSpanProcessor(otlp_exporter) trace.get_tracer_provider().add_span_processor(span_processor) with tracer.start_as_current_span("foo"): print("Hello world!")API
Bases: Enum
An enumeration.
Bases: SpanExporter
Exports a batch of telemetry data.
spans (Sequence
[ReadableSpan
]) – The list of opentelemetry.trace.Span objects to be exported
The result of the export
Shuts down the exporter.
Called when the SDK is shut down.
Nothing is buffered in this exporter, so this method does nothing.
Bases: MetricExporter
, OTLPMetricExporterMixin
Exports a batch of telemetry data.
metrics – The list of opentelemetry.sdk.metrics.export.Metric objects to be exported
The result of the export
Shuts down the exporter.
Called when the SDK is shut down.
Nothing is buffered in this exporter, so this method does nothing.
List
[Resource
]
Bases: LogExporter
Exports a batch of logs. :type batch: Sequence
[LogData
] :param batch: The list of LogData objects to be exported
LogExportResult
The result of the export
Nothing is buffered in this exporter, so this method does nothing.
Shuts down the exporter.
Called when the SDK is shut down.
This library allows to export tracing data to an OTLP collector.
UsageThe OTLP Span Exporter allows to export OpenTelemetry traces to the OTLP collector.
You can configure the exporter with the following environment variables:
from opentelemetry import trace from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter from opentelemetry.sdk.resources import Resource from opentelemetry.sdk.trace import TracerProvider from opentelemetry.sdk.trace.export import BatchSpanProcessor # Resource can be required for some backends, e.g. Jaeger # If resource wouldn't be set - traces wouldn't appears in Jaeger resource = Resource(attributes={ "service.name": "service" }) trace.set_tracer_provider(TracerProvider(resource=resource)) tracer = trace.get_tracer(__name__) otlp_exporter = OTLPSpanExporter(endpoint="http://localhost:4317", insecure=True) span_processor = BatchSpanProcessor(otlp_exporter) trace.get_tracer_provider().add_span_processor(span_processor) with tracer.start_as_current_span("foo"): print("Hello world!")API
OTLP Span Exporter
Bases: SpanExporter
, OTLPExporterMixin
[ReadableSpan
, ExportTraceServiceRequest
, SpanExportResult
]
OTLP span exporter
endpoint (Optional
[str
]) – OpenTelemetry Collector receiver endpoint
credentials (Optional
[ChannelCredentials
]) – Credentials object for server authentication
headers (Union
[Sequence
[Tuple
[str
, str
]], Dict
[str
, str
], str
, None
]) – Headers to send when exporting
timeout (Optional
[float
]) – Backend request timeout in seconds
compression (Optional
[Compression
]) – gRPC compression method to use
Exports a batch of telemetry data.
spans (Sequence
[ReadableSpan
]) – The list of opentelemetry.trace.Span objects to be exported
The result of the export
Shuts down the exporter.
Called when the SDK is shut down.
Nothing is buffered in this exporter, so this method does nothing.
Bases: MetricExporter
, OTLPExporterMixin
[Metric
, ExportMetricsServiceRequest
, MetricExportResult
], OTLPMetricExporterMixin
OTLP metric exporter
endpoint (str | None) – Target URL to which the exporter is going to send metrics
max_export_batch_size (int | None) – Maximum number of data points to export in a single request. This is to deal with gRPC’s 4MB message size limit. If not set there is no limit to the number of data points in a request. If it is set and the number of data points exceeds the max, the request will be split.
Exports a batch of telemetry data.
metrics – The list of opentelemetry.sdk.metrics.export.Metric objects to be exported
The result of the export
Shuts down the exporter.
Called when the SDK is shut down.
Nothing is buffered in this exporter, so this method does nothing.
Bases: LogExporter
, OTLPExporterMixin
[LogRecord
, ExportLogsServiceRequest
, LogExportResult
]
Exports a batch of logs. :type batch: Sequence
[LogData
] :param batch: The list of LogData objects to be exported
LogExportResult
The result of the export
Shuts down the exporter.
Called when the SDK is shut down.
Nothing is buffered in this exporter, so this method does nothing.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4