Send Logs to Grafana Cloud
Logs are files that list things that have happened, events related to things like a computer’s operating system or software running on that system. These are typically recorded as a list of messages in a file, often including a time stamp to record when the event occurred.
Get started with Grafana Cloud Logs
To get up and running with logs in Grafana cloud, you need to start sending your log data to the log ingestion endpoint. This can be done by either collecting logs with Grafana Agent or using promtail.
As Grafana Cloud Logs works by indexing only metadata instead of the full text log line, you should carefully consider the set of labels sent.
Good examples include:
- Hostname
- Environment
- Service
Avoid indexing high cardinality fields like usernames, order ids or request parameters. Read the documentation page on Labels to learn how to use labels effectively for the best experience.
After beginning to send data, you can start to query it using the Explore
tab or create your own visualizations. This is how you might integrate logs into a panel in Grafana Cloud:
A deeper introduction to Loki
Loki is the horizontally scalable, highly available, multi-tenant log aggregation system powering Grafana Cloud logs. It is designed to be cost-effective and easy to operate. It does not index the contents of the logs, but rather a set of labels for each log stream. This allows for high developer velocity while still being easy and fast to query.
Compared to other log aggregation systems, Loki:
- Does not do full text indexing on logs. By storing compressed, unstructured logs and only indexing metadata, Loki is simpler to operate and cheaper to run.
- Indexes and groups log streams using the same labels you’re already using with Prometheus, enabling you to seamlessly switch between metrics and logs using the same labels that you’re already using with Prometheus.
- Is an especially good fit for storing Kubernetes Pod logs. Metadata such as Pod labels is automatically scraped and indexed.
- Has native support in Grafana (needs Grafana v6.0+).
Loki is like Prometheus, but for logs: we prefer a multidimensional label-based approach to indexing, and want a single-binary, easy to operate system with no dependencies. Loki differs from Prometheus by focusing on logs instead of metrics, and delivering logs via push, instead of pull.
Further reading
This annotated list of additional resources is provided for both context and to help you discover ways to use Loki with greater success and ease.
Delete accidentally exposed information
If you accidentially logged sensitive information, you can delete them from our systems by following this guide: Delete unwanted information in log lines.
Drop sensitive information
- For more information on collecting logs using Promtail, refer to Collect logs with Promtail.
Note
Read Labels to learn how to use labels effectively for the best experience.
Send Cloudwatch logs
To send Cloudwatch logs to Loki, see how to use an intermediary Lambda Promtail function created especially for this task.
Was this page helpful?
Related resources from Grafana Labs
![Getting started with the Grafana LGTM Stack](/static/assets/featured/getting-started-with-grafana-lgtm-stack-amer_featured.png?w=200 200w, /static/assets/featured/getting-started-with-grafana-lgtm-stack-amer_featured.png?w=400 400w)
![Intro to Kubernetes monitoring in Grafana Cloud](/media/webinar/Screenshot-2024-02-12-at-4.09.30-PM.png?w=200 200w, /media/webinar/Screenshot-2024-02-12-at-4.09.30-PM.png?w=400 400w)
![Building advanced Grafana dashboards](/media/webinar/AMER_buildadv_notxt.png?w=200 200w, /media/webinar/AMER_buildadv_notxt.png?w=400 400w)