-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add Loki documentation * Apply suggestions from code review Co-authored-by: Tobias Brunner <[email protected]> * Add Loki documentation --------- Co-authored-by: Tobias Brunner <[email protected]>
- Loading branch information
1 parent
831a61e
commit 814e3fc
Showing
8 changed files
with
139 additions
and
36 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 0 additions & 35 deletions
35
docs/modules/ROOT/pages/how-to/access-logs-through-kibana.adoc
This file was deleted.
Oops, something went wrong.
99 changes: 99 additions & 0 deletions
99
docs/modules/ROOT/pages/tutorials/logging/getting-started.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
= Getting started with logging | ||
|
||
This tutorial explains how to view the logs of an application on the OpenShift Web Console with the LokiStack. | ||
|
||
|
||
== Requirements | ||
|
||
To follow this guide, please make sure that you have the following tools installed: | ||
|
||
`oc`:: You can download the OpenShift command directly from OpenShift Web Console. Open the help menu (marked as a question mark at the top right) and select the "Command line tools" entry. | ||
|
||
|
||
== Step 1: Deploy Fortune application | ||
|
||
. Create a new namespace called `demo-fortune` | ||
+ | ||
[source,shell] | ||
-- | ||
oc new-project demo-fortune | ||
-- | ||
+ | ||
[TIP] | ||
==== | ||
If you get an error that the namespace already exists, please pick another name and try again. | ||
We recommend prefixing the name with the name of your organization to minimize potential for name collisions. | ||
==== | ||
|
||
. Create Fortune application manifest | ||
+ | ||
.Manifest for Fortune application | ||
[source,yaml] | ||
-- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
app: fortune-cookie | ||
name: fortune-cookie | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: fortune-cookie | ||
template: | ||
metadata: | ||
labels: | ||
app: fortune-cookie | ||
spec: | ||
containers: | ||
- image: registry.gitlab.com/vshn/applications/fortune-go:latest | ||
imagePullPolicy: IfNotPresent | ||
name: fortune-cookie | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
app: fortune-cookie | ||
name: fortune-cookie | ||
spec: | ||
ports: | ||
- port: 8080 | ||
protocol: TCP | ||
targetPort: 8080 | ||
name: web | ||
selector: | ||
app: fortune-cookie | ||
type: ClusterIP | ||
-- | ||
|
||
. Deploy Fortune application manifest | ||
+ | ||
[source,shell] | ||
-- | ||
oc apply -f fortune.yaml | ||
-- | ||
|
||
. Expose Fortune application | ||
+ | ||
[source,shell] | ||
-- | ||
oc expose svc/fortune-cookie | ||
-- | ||
|
||
|
||
== Step 2: View Fortune application logs | ||
|
||
* The current / live logs can be viewed from the logs tab of the pod | ||
+ | ||
image::logging/fortune-podlogs.png[] | ||
|
||
* To access the aggregated logs from all pods, change to the aggregated logs tab | ||
+ | ||
[source] | ||
-- | ||
{ kubernetes_container_name="fortune-cookie" } | json | ||
-- | ||
+ | ||
image::logging/fortune-aggregated.png[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
= Query application logs | ||
:page-aliases: how-to/access-logs-through-kibana.adoc | ||
|
||
[NOTE] | ||
==== | ||
Kibana is deprecated and has been replaced with LokiStack. | ||
==== | ||
|
||
Open the console in the `Administrator` view and switch to `Logs` in the `Observe` section. | ||
You can query the logs using Grafanas https://grafana.com/docs/loki/latest/logql[LogQL]. | ||
|
||
|
||
== View namespace logs | ||
|
||
* View logs by selecting namespace in the UI | ||
+ | ||
image::logging/namespace-logs.png[] | ||
|
||
* Or use the query language | ||
+ | ||
[source] | ||
-- | ||
{ kubernetes_namespace_name="demo-fortune" } | json | ||
-- | ||
|
||
|
||
== View error logs | ||
|
||
* Filter by logtype `error` in the UI | ||
+ | ||
image::logging/error-logs.png[] | ||
|
||
* Or use the query language | ||
+ | ||
[source] | ||
-- | ||
{ kubernetes_namespace_name="syn-kyverno" } | json | level=~"error|err|eror" | ||
-- |