The Open Telemetry server#

Configuration#

Within the OtelServer section of the manifest file you can configure how to connect to an open telemetry endpoint. At the moment mqtt2otel does not provide an otel collector so an external one has to be used.

A simple example for an otel connection would look like that:

1OtelServer:
2  - Name: "My Otel server"
3    ServiceName: "my-service"
4    ServiceNamespace: "my-service-namespace"
5    Endpoint:
6      Protocol: "http"
7      Port: 4317
8      Address: "my-otel-collector.net"
9      EnableTls: false

It has the following parameters:

ParameterDescription
NameAn optional name that can be given to the otel server. With this the server can be refered to later.
DescriptionAn optional description of the server
ServiceNameThe otel service name
ServiceVersionThe otel service version
ServiceNamespaceThe otel service namespace
Eendpoint.ProtocolThe optional protocol that will be used for connecting to the broker, e.g. https
Endpoint.AddressThe address of the otel server
Endpoint.PortThe optional port under which the broker can be reached. Default is 4317.
Endpoint.HeadersOptional: The http headers, that will be send to the server on each request.
Endpoint.BatchTimeoutInMsOptional. The maximum waiting time for the server to process a batch.
Endpoint.EnableTlsSet to false to disable transport level security (TLS). Default is true.
Endpoint.ClientCertificatePathOptional. Set a file path for a client certificate file.
Endpoint.ClientCertificatePasswordOptional. The password to access the provided client certificate.
OtlpExportProtocolOptional. The export protocol that should be used: Grpc or HttpProtobuf. Default is HttpProtobuf.
ExportProcessorTypeOptional. The export processor type that should be used: Batch or Simple. Default is Batch.
ClientPrefixA prefix that will be added to the client id when connecting to the server. Helps to identify the client.

The export processor type#

ExportProcessorType

It’s important to understand the differences in the processor types to ensure the system behaves as you would expect:

  • The batch type will collect messages in a batch and then send them together to the otel endpoint. This reduces network traffic, but increases latency. This is typically a good choice if you don`t need realtime data.
  • The simple type will send the messages directly to the server. This may produce a lot of network traffic, but has a low latency. This may be your best choice if you need real time data.

Using multiple connections#

The OtelServer section contains a list of servers. That means you can add multiple servers. The first server in this list is always the default server, that will be used if nothing else is specified. If you want to address another broker, than the default you have to use the provided name of the server.