Jasuade docs patch 1 (#68074)

* Docs update Logs in Explore

* Include new Calculation Types :docs:

* Update docs/sources/explore/logs-integration.md

Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>

* Update docs/sources/explore/logs-integration.md

Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>

* Update docs/sources/explore/logs-integration.md

Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>

* Update docs/sources/explore/logs-integration.md

Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>

* Eye icon instead of Toggle field visibility

* running prettier

---------

Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
Co-authored-by: Isabel Matwawana <isabel.matwawana@grafana.com>
This commit is contained in:
Jara Suárez de Puga García 2023-05-23 20:56:51 +02:00 committed by GitHub
parent 34d294bf56
commit 753c9c262c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 17 deletions

View File

@ -9,17 +9,13 @@ weight: 15
# Logs in Explore
Along with metrics, Explore allows you to investigate your logs in the following data sources:
Along with metrics, Explore allows you to investigate your logs across several data sources including:
- [Elasticsearch]({{< relref "../datasources/elasticsearch/" >}})
- [InfluxDB]({{< relref "../datasources/influxdb/" >}})
- [Loki]({{< relref "../datasources/loki/" >}})
During an infrastructure monitoring and incident response, you can dig deeper into the metrics and logs to find the cause. Explore also allows you to correlate metrics and logs by viewing them side-by-side. This creates a new debugging workflow:
1. Receive an alert.
1. Drill down and examine metrics.
1. Drill down again and search logs related to the metric and time interval (and in the future, distributed traces).
During monitoring, troubleshooting, and incident response, you can dig deeper into the metrics and logs to find the cause of the issue. Explore also allows you to correlate metrics and logs by viewing them side-by-side.
## Logs visualization
@ -27,7 +23,7 @@ Results of log queries are shown as histograms in the graph and individual logs
If the data source supports a full range log volume histogram, the graph with log distribution for all entered log queries is shown automatically. This feature is currently supported by Elasticsearch and Loki data sources.
**NOTE:** In Loki, this full range log volume histogram is rendered by metric query which can be expensive depending on time range queried. This query may be particularly challenging for smaller Loki installations to process. To mitigate this, we recommend using a proxy like [nginx](https://www.nginx.com/) in front of Loki to set a custom timeout (e.g. 10 seconds) for these queries. Log volume histogram queries can be identified by looking for queries with the HTTP header `X-Query-Tags` with value `Source=logvolhist`; these headers are added by Grafana to all log volume histogram queries.
> **Note:** In Loki, this full range log volume histogram is rendered by metric query which can be expensive depending on time range queried. This query may be particularly challenging for smaller Loki installations to process. To mitigate this, we recommend using a proxy like [nginx](https://www.nginx.com/) in front of Loki to set a custom timeout (for example, 10 seconds) for these queries. Log volume histogram queries can be identified by looking for queries with the HTTP header `X-Query-Tags` with value `Source=logvolhist`; these headers are added by Grafana to all log volume histogram queries.
If the data source does not support loading full range log volume histogram, the logs model computes a time series based on the log row counts bucketed by an automatically calculated time interval, and the first log row's timestamp then anchors the start of the histogram from the result. The end of the time series is anchored to the time picker's **To** range.
@ -62,7 +58,7 @@ For logs where a level label is specified, we use the value of the label to dete
## Logs navigation
Logs navigation next to the log lines can be used to request more logs. You can do this by clicking on Older logs button on the bottom of navigation. This is especially useful when you hit the line limit and you want to see more logs. Each request that is run from the navigation is then displayed in the navigation as separate page. Every page is showing from and to timestamp of the incoming log lines. You can see previous results by clicking on the page. Explore is caching last five requests run from the logs navigation, so you are not re-running the same queries when clicking on the pages.
Logs navigation, at the right side of the log lines, can be used to request more logs. You can do this by clicking the **Older logs** button at the bottom of the navigation. This is especially useful when you hit the line limit and you want to see more logs. Each request that's run from the navigation is then displayed in the navigation as separate page. Every page shows `from` and `to` timestamps of the incoming log lines. You can see previous results by clicking on the page. Explore caches the last five requests run from the logs navigation, so you're not re-running the same queries when clicking on the pages.
![Navigate logs in Explore](/static/img/docs/explore/navigate-logs-8-0.png)
@ -94,13 +90,14 @@ Log data can be very repetitive and Explore can help by hiding duplicate log lin
- **Numbers -** Matches on the line after stripping out numbers such as durations, IP addresses, and so on.
- **Signature -** The most aggressive deduplication, this strips all letters and numbers and matches on the remaining whitespace and punctuation.
### Flip results order
### Display results order
You can change the order of received logs from the default descending order (newest first) to ascending order (oldest first).
## Labels and detected fields
Each log row has an extendable area with its labels and detected fields, for more robust interaction. You can filter for (positive filter) and filter out (negative filter) selected labels. Each field or label also has a stats icon to display ad-hoc statistics in relation to all displayed logs.
Each log line has an extendable area, with its labels and detected fields, for more robust interaction. You can filter for (positive filter) and filter out (negative filter) selected labels. Additionally, you can select a unique field to visualize instead of the whole log line by clicking on the eye icon.
Finally, each field or label also has a stats icon to display ad-hoc statistics in relation to all displayed logs.
## Escaping newlines
@ -128,12 +125,6 @@ You may encounter long lines of text that make it difficult to read and analyze
The **Open in split view** button allows you to execute the context query for a log entry in a split screen in the Explore view. Clicking this button will open a new Explore pane with the context query displayed alongside the log entry, making it easier to analyze and understand the surrounding context.
## Toggle field visibility
Expand a log line and click the eye icon to show or hide fields.
{{< figure src="/static/img/docs/explore/toggle-fields-9-4.gif" max-width="800px" caption="Toggling detected fields in Explore" >}}
## Loki-specific features
As mentioned, one of the log integrations is for the new open source log aggregation system from Grafana Labs - [Loki](https://github.com/grafana/loki). Loki is designed to be very cost effective, as it does not index the contents of the logs, but rather a set of labels for each log stream. The logs from Loki are queried in a similar way to querying with label selectors in Prometheus. It uses labels to group log streams which can be made to match up with your Prometheus labels. For more information about Grafana Loki, refer to [Grafana Loki](https://github.com/grafana/loki) or the Grafana Labs hosted variant: [Grafana Cloud Logs](https://grafana.com/loki).

View File

@ -14,6 +14,8 @@ The following table contains a list of calculations you can perform in Grafana.
| Calculation | Description |
| :----------------- | :-------------------------------------------------------- |
| All nulls | True when all values are null |
| All values | Array with all values |
| All unique values | Array with all unique alues |
| All zeros | True when all values are 0 |
| Change count | Number of times the field's value changes |
| Count | Number of values in a field |
@ -21,7 +23,10 @@ The following table contains a list of calculations you can perform in Grafana.
| Difference | Difference between first and last value of a field |
| Difference percent | Percentage change between first and last value of a field |
| Distinct count | Number of unique values in a field |
| First (not null) | First, not null value in a field |
| First | First value in a field |
| First\* (not null) | First, not null value in a field |
| Last | Last value in a field |
| Last\* (not null) | Last, not null value in a field |
| Max | Maximum value of a field |
| Mean | Mean value of all values in a field |
| Variance | Variance of all values in a field |