Overview
This guide explains how to collect application and server logs from your EC2 instances using the OpenTelemetry Collector.
✅ Info
This guide assumes you have already installed the OpenTelemetry Collector on your EC2 instance. If not, see Install OpenTelemetry Collector on VM.
Prerequisites
- A Linux-based EC2 instance
- OpenTelemetry Collector installed and running
- Access to modify the collector's configuration file (usually
config.yaml)
Setup
To collect logs from your EC2 instance, you will need to configure the filelog receiver in your OpenTelemetry Collector.
For complete configuration instructions, follow the Collect Logs from File guide.
The setup involves:
- Defining the input: Specifying the path to your log files (e.g.,
/var/log/myapp.log) in thefilelogreceiver configuration. - Enabling the pipeline: Adding the receiver to a logs pipeline in the
config.yamlfile. - Restarting the Collector: Applying the new configuration.
Validate
Once you have updated the configuration and restarted the collector:
- Generate some logs in your application or log file.
- Go to the Logs Explorer in SigNoz.
- You should see your logs appearing. You can filter by
host.name(which usually defaults to the EC2 instance ID or hostname) to find logs from this specific instance.
