omni::telemetry::kTelemetryEndpointSettingLeaf

Defined in omni/structuredlog/Telemetry.h

constexpr const char *const omni::telemetry::kTelemetryEndpointSettingLeaf = "endpoint"

This setting is an optional member of the kTransmitterSetting object.

Sets the URL to send the telemetry events to. This can be used to send the events to a custom endpoint. This will override the default URL inferred by kTelemetryModeSetting. By default, the kTelemetryModeSetting setting will determine the endpoint URL to use. You can set this as an array if you want to specify multiple fallback endpoints to use if the retry limit is exhausted; each endpoint will be tried in order and will be abandoned if connectivity fails after the retry limit.

This may also be a file URI if the output is to be written to a local log file. In this case, this must be a “file:///” style URI since only local files are supported (ie: no server or host name component). This file URI may also point to the special paths /dev/stdout or /dev/stderr (ie: as “file:///dev/stdout”) to output to stdout or stderr respectively (supported on all platforms). When a local file or stdout/stderr is used as the destination endpoint, all newly processed events will simply be appended to the end of the log file. Exclusive write access to the local log file is expected while the transmitter is running. The transmitter will lock the file (except stdout and stderr) while writing to it, but will close the log after each write. If another process needs to read from it, advisory locking should be used to guarantee the contents are not in a partial state. On Windows, this locking should be done using one of the LockFile*() functions. On Posix platforms that support file locking, this should be done using either fcntl(f, F_SETLKW, ...) for a blocking lock or fcntl(f, F_SETLK, ...) for a non-blocking lock. Each line in the log file will represent a single output event.

Note

Writing the transmitter output to a log file is only supported with the ‘default’ and defaultWithStringify output protocols kEventProtocolLeaf. If another event protocol is used, it will be reverted to default instead. A warning message will be output in this case.

Note

When outputting data to a file instead of a server URL, authentication will be implicitly disabled since it is not needed. If the file URI should ever fail and be removed from the transmitter (unlikely except in situations where for example the device is full), the original specified state of the authentication flag will be restored. In almost all situations, there is no need to authenticate with anything when writing a local file. Leaving authentication enabled (the default behavior) would just lead to that transmitter object simply sitting idle if the authentication information could not be downloaded. The authentication can be disabled using the kTelemetryAuthenticateSettingLeaf setting.