OTelExporter constructor
Creates an OTLP/HTTP exporter that POSTs to endpoint.
headers are merged into every request on top of the default
Content-Type: application/json header. serviceName is reported as
the service.name resource attribute. An optional httpClient may be
injected for testing; otherwise the exporter owns and closes its
client in close.
Implementation
OTelExporter({
required Uri endpoint,
Map<String, String> headers = const {},
String serviceName = 'dart_ipfs',
http.Client? httpClient,
Logger? logger,
Duration requestTimeout = const Duration(seconds: 10),
}) : _endpoint = endpoint,
_headers = Map.unmodifiable(headers),
_serviceName = serviceName,
_httpClient = httpClient ?? http.Client(),
_ownsHttpClient = httpClient == null,
_logger = logger ?? Logger('OTelExporter'),
_requestTimeout = requestTimeout;