3. Start Demo
Start Demo#
Enter Required Information
During the next step you will be prompted for some details.
Enter the relevant details in the GitHub form.
Click this button to launch the demo in a new tab.
- Clone the repository to your local machine
git clone https://github.com/dynatrace/obslab-syslog
- Open the folder in Visual Studio code
- Ensure the Microsoft Dev Containers extension and Dev Containers CLI are installed in VSCode
- Open a new terminal in VSCode and set your environment variables as appropriate:
set DT_ENVIRONMENT_ID=abc12345
set DT_ENVIRONMENT_TYPE=live
set DT_API_TOKEN=dt0c01.******.***********
- Start Docker / Podman
- Create the environment
devcontainer up
It will take a few moments but you should see:
{"outcome":"success","containerId":"...","remoteUser":"root","remoteWorkspaceFolder":"/workspaces/obslab-jmeter"}
- Connect to the demo environment. This will launch a new Visual Studio Code window
devcontainer open
In the new Visual Studio code window, open a new terminal and continue with the tutorial.
Understand Demo Environment#
The Dynatrace OpenTelemetry Collector (./dynatrace-otel-collector
) is automatically downloaded at startup. The collector is the syslog server. This collector distribution is officially supported by Dynatrace.
Data will be sent to the collector (from a device) and the collector will forward that data to Dynatrace.
The collector requires a configuration file. This is also already present (config.yaml
).
To generate syslog data, we need a "fake" device to generate the data and send it to the syslog server (ie. the collector). For this, we use a Python script (syslog_generator.py
).
The Python script:
- Reads
sample_log_lines.log
- Uses these logs lines as a seed to generate random syslog entries
- The
host
,tag
,level
andpid
are randomised for each log line
- The
- Sends the syslog entry via UDP to the collector
Understand Collector Configuration#
Understanding the configuration of the collector is key to understanding how the data gets from your devices into Dynatrace.
Note: You do not need to modify config.yaml
file.
Receivers#
receivers:
syslog:
udp:
listen_address: "127.0.0.1:54526"
protocol: rfc3164
The receivers block describes how data is received by the collector.
In this case, the syslog receiver is listening for incoming UDP
connections on port 54526
and expecting incoming messages to by formatted in RFC3164 format.
Exporters#
exporters:
debug:
verbosity: detailed
otlphttp:
endpoint: "https://YourTenantID.live.dynatrace.com/api/v2/otlp"
headers:
Authorization: "Api-Token ${env:DT_API_TOKEN}"
The exporters block defines what happens to the data at the point it leaves the collector.
The otlphttp
exporter sends data to an endpoint in OpenTelemetry Protocol (OTLP) format via HTTPS. Dynatrace natively understands the OTLP format.
Notice that an environment variables is referenced: DT_API_TOKEN
you may recall these from the form you completed when the codespace started. The Dynatrace URL is automatically build (by the codespace at startup) and placed into the config.yaml file. You do not need to change config.yaml
.
These environment variables are already set for you, so you don't need to do anything else.
Pipelines#
service:
pipelines:
logs:
receivers: [syslog]
exporters: [otlphttp]
The pipelines block defines how the collector components are connected in an end-to-end pipeline.
In this case, 1
pipeline (dealing with log data) is defined. This pipeline will receive data using the syslog
receiver and export it to the otlphttp
exporters simultaneously.