菜单
文档breadcrumb arrow Grafana Alloybreadcrumb arrow 参考breadcrumb arrow 组件breadcrumb arrow prometheusbreadcrumb arrow prometheus.exporter.oracledb
正式发布 (GA) 开源

prometheus.exporter.oracledb

prometheus.exporter.oracledb 组件嵌入了 oracledb_exporter,用于收集 OracleDB 服务器的统计信息。

用法

alloy
prometheus.exporter.oracledb "<LABEL>" {
    connection_string = "<CONNECTION_STRING>"
}

参数

您可以使用以下参数配置 prometheus.exporter.oracledb 组件

名称类型描述默认值必需
connection_stringsecret用于连接 Oracle 数据库的连接字符串。
max_idle_connsint连接池中最大空闲连接数。0
max_open_connsint连接池中最大打开连接数。10
query_timeoutint查询超时时间,单位为秒。5

oracledb_exporter 的运行文档 显示了 connection_string 参数的格式并提供了示例。

conn
oracle://user:pass@server/service_name[?OPTION1=VALUE1[&OPTIONn=VALUEn]...]

prometheus.exporter.oracledb 组件不支持任何块。您可以通过参数配置此组件。

导出字段

导出以下字段,供其他组件引用。

名称类型描述
targetslist(map(string))可用于收集 exporter 指标的目标。

例如,可以将 targets 传递给 discovery.relabel 组件来重写目标的标签集,或传递给 prometheus.scrape 组件来收集暴露的指标。

导出的 targets 使用 in-memory traffic 地址,该地址由 run 命令 指定。

组件健康状态

prometheus.exporter.oracledb 仅在配置无效时报告为不健康。在这种情况下,导出字段会保留其上次健康时的值。

调试信息

prometheus.exporter.oracledb 不暴露任何组件特定的调试信息。

调试指标

prometheus.exporter.oracledb 不暴露任何组件特定的调试指标。

示例

以下示例使用 prometheus.scrape 组件prometheus.exporter.oracledb 收集指标

alloy
prometheus.exporter.oracledb "example" {
  connection_string = "oracle://user:password@localhost:1521/orcl.localnet"
}

// Configure a prometheus.scrape component to collect oracledb metrics.
prometheus.scrape "demo" {
  targets    = prometheus.exporter.oracledb.example.targets
  forward_to = [prometheus.remote_write.demo.receiver]
}

prometheus.remote_write "demo" {
  endpoint {
    url = "<PROMETHEUS_REMOTE_WRITE_URL>"

    basic_auth {
      username = "<USERNAME>"
      password = "<PASSWORD>"
    }
  }
}

替换以下内容

  • <PROMETHEUS_REMOTE_WRITE_URL>:用于向 Prometheus remote_write 兼容服务器发送指标的 URL。
  • <USERNAME>:用于向 remote_write API 进行身份验证的用户名。
  • <PASSWORD>:用于向 remote_write API 进行身份验证的密码。

兼容组件

prometheus.exporter.oracledb 具有可供以下组件使用的导出项

注意

连接某些组件可能不合理,或者组件可能需要进一步配置才能正常工作。详情请参阅相关文档。