Multitenant Logging
Get acquainted with the multitenant logging components.
Logging Components​
To configure the multitenant logging, it is necessary to deploy the following components:
In Grafana, every tenant represents an organization, i.e. it is necessary to create an organization for every namespace in the cluster. To get more details regarding the architecture of the Logging Operator, review the Diagram below.
It is necessary to deploy Loki with the auth_enabled: true
flag with the aim to ensure that the logs are separated for each tenant. For the authentication, Loki requires the HTTP header X-Scope-OrgID
.
Review Project Logs in Grafana​
To find the project logs, navigate to Grafana and follow the steps below:
Grafana is a common service for different customers where each customer works in its own separated Grafana Organization and doesn't have any access to another project.
- Grafana < v9.5.0
- Grafana >= v9.5.0
-
Choose the organization by clicking the Current Organization drop-down list. If a user is assigned to several organizations, switch easily by using the Switch button:
-
Navigate to the left-side menu and click the Explore button to see the Log Browser:
-
Click the Log Browser button to see the labels that can be used to filter logs (e.g., hostname, namespace, application name, pod, etc.):
noteEnable the correct data source, select the relevant logging data from the top left-side corner, and pay attention that the data source name always follows the
project_name-logging
pattern. -
Filter out logs by clicking the Show logs button or write the query and click the Run query button.
-
Review the results with the quantity of logs per time, see the example below:
-
Expand the logs to get detailed information about the object entry:
-
Use the following buttons to include or remove the labels from the query:
-
See the ad-hoc statistics for a particular label:
-
-
Choose the organization from the drop-down list in the upper left corner:
-
Navigate to the left-side menu and click the Explore button:
-
Click the Label Browser button to see the labels that can be used to filter logs:
noteEnable the correct data source, select the relevant logging data from the top left-side corner, and pay attention that the data source name always follows the
project_name-logging
pattern. -
In the appeared window, select the labels to filter logs (e.g., hostname, namespace, application name, pod, etc.):
-
Close the Label Browser window and click the Run query button. Review the results with the quantity of logs per time, see the example below:
-
Expand the logs to get detailed information about the object entry. Use the following buttons to include or remove the labels from the query:
-
See the ad-hoc statistics for a particular label:
-