OpenShift Pipelines 中的可观察性


Red Hat OpenShift Pipelines 1.10

OpenShift Pipelines 的可观察性功能

Red Hat OpenShift Documentation Team

摘要

本文档提供有关 OpenShift Pipelines 的可观察性功能的信息。

管道运行、任务运行和事件侦听器生成的日志存储在其各自的 pod 中。检查和分析用于故障排除和审计的日志非常有用。

但是,保留 pod 不会造成不必要的资源消耗和杂乱的命名空间。

要消除对 pod 查看管道日志的依赖,您可以使用 OpenShift Elasticsearch Operator 和 OpenShift Logging Operator。这些 Operator 可帮助您使用 Elasticsearch Kibana 堆栈查看管道日志,即使您删除了包含日志的 pod。

1.1. 先决条件

在 Kibana 仪表板中尝试查看管道日志前,请确保以下内容:

  • 步骤由集群管理员执行。
  • 管道运行和任务运行的日志可用。
  • 安装了 OpenShift Elasticsearch Operator 和 OpenShift Logging Operator。

1.2. 在 Kibana 中查看管道日志

在 Kibana web 控制台中查看管道日志:

流程

  1. 以集群管理员身份登录到 OpenShift Container Platform Web 控制台。
  2. 在菜单栏右上角,点击 grid 图标 → ObservabilityLogging。这时会显示 Kibana Web 控制台。
  3. 创建索引模式:

    1. Kibana Web 控制台左侧导航面板中,点击 Management
    2. 单击 Create index pattern
    3. Step 1 of 2: Define index patternIndex pattern 中输入一个 * 特征并点 Next Step
    4. Step 2 of 2: Configure settingsTime filter field name 中,从下来菜单中选择 @timestamp,点 Create index pattern
  4. 添加过滤器:

    1. Kibana Web 控制台左侧导航面板中,点 Discover
    2. Add a filter +Edit Query DSL

      注意
      • 对于以下每个示例过滤器,编辑查询并单击 Save
      • 这些过滤器会逐个应用。
      1. 过滤与管道相关的容器:

        过滤管道容器的查询示例

        {
          "query": {
        	"match": {
          	"kubernetes.flat_labels": {
            	"query": "app_kubernetes_io/managed-by=tekton-pipelines",
            	"type": "phrase"
          	}
        	}
          }
        }
        Copy to Clipboard Toggle word wrap

      2. 过滤所有不是 place-tools 容器的容器。作为使用图形下拉菜单而不是编辑查询 DSL 的一个示例,请考虑以下方法:

        图 1.1. 使用下拉列表字段进行过滤示例

        Not place-tools
      3. 在标签中过滤 pipelinerun 以高亮显示:

        在标签中过滤 pipelinerun 的查询示例

        {
          "query": {
        	"match": {
          	"kubernetes.flat_labels": {
            	"query": "tekton_dev/pipelineRun=",
            	"type": "phrase"
          	}
        	}
          }
        }
        Copy to Clipboard Toggle word wrap

      4. 在标签中过滤 pipeline 以高亮显示:

        在标签中过滤 pipeline 以高亮显示的查询示例

        {
          "query": {
        	"match": {
          	"kubernetes.flat_labels": {
            	"query": "tekton_dev/pipeline=",
            	"type": "phrase"
          	}
        	}
          }
        }
        Copy to Clipboard Toggle word wrap

    3. Available fields 列表中,选择以下字段:

      • kubernetes.flat_labels
      • message

        确保所选字段显示在 Selected fields 列表下。

    4. 日志显示在 message 字段下。

      图 1.2. 过滤的消息

      过滤的消息

法律通告

Copyright © 2023 Red Hat, Inc.
The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部