Configure Samplers using neblictl¶
The neblictl
command connects with the Neblic Control Plane
server and allows its user to get information and configure all the Samplers
in the system.
Installation¶
You can download a precompiled binary on the releases page. If you want to build it go install
won't work because its go.mod
has replace directives, so you need to clone the entire platform repository and build it in the neblictl
folder.
It is also bundled with the otelcol
container image that Neblic distributes so you can run it from inside the container.
Usage¶
Connect to the Control Plane
server¶
On first use, it will initialize a configuration file at the path returned by this function. You will only need to manually edit this file for some advanced usages (e.g. connecting to a Control Plane
server that uses Bearer authentication, see next section).
You will need to provide the address and port of the Control Plane
server (default localhost:8899
) to use it.
Neblictl
provides an interactive client with auto-completion and built-in help where you will be able to enter commands once connected.
Set a Bearer token¶
- Run
neblictl init
to create the configuration file if necessary and show its path. - Open the configuration file and set the desired token value in the
Token
field.
Configure a Sampler
¶
Before continuing there are two main concepts that you need to understand: Samplers
and Sampling Rules
. Check the concepts page to learn more about them.
- Run the command
list samplers
. This will show a list with all theSamplers
available and some stats for each one of them. - Create a rule using the commend
create rule <resource> <sampler> <sampling_rule>
. - After a while, you can check the
Sampler
stats to see if the number of exported samples has increased runninglist samplers
again.
Set a Sampling Rate
¶
It's usually useful to set a rate limit as a safeguard to avoid exporting too many samples, the sample rate limits the number of samples per second that can be exported, discarding the ones above the limit. By default, a sampling rate is defined when a sampler is initialized in the service code, but this value can be overridden using the client with the command create rate <resouce> <sampler> <limit>
Documentation¶
See the neblictl reference page to see all the available commands.