Boolean fields missing from fieldTypeMap

未关闭 适合新手
#180 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
74/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清
技术栈
typescript
领域
frontend

调研方向

从 src/utils/index.ts 开始,检查 fieldTypeMap 以及将 _field_caps 类型映射到字段选择器的代码。添加对 boolean 的处理,并检查筛选器运算符选择是否会以字符串形式接收 boolean 值。完成的标准是:boolean 字段具有预期类型,会出现在按类型筛选的选择器和 autocomplete 建议中,并且筛选器选择能够正确处理它们。

由索引模型根据 Issue 内容生成。

描述

Problem

Quickwit's _field_caps endpoint reports boolean fields as type boolean, but the plugin's fieldTypeMap in src/utils/index.ts does not include a boolean entry. This means:

  1. Boolean fields get type: undefined when mapped through fieldTypeMap
  2. They are excluded from type-filtered field pickers (e.g. when the query editor requests "number" or "string" fields)
  3. They may not appear in autocomplete suggestions

Scope

In our OTEL log index, there are 157 boolean fields (dynamic JSON subfields). These are fields like attributes.attr.command.ignoreUnknownIndexOptions that have boolean values in the indexed JSON documents.

Fix

Add boolean to fieldTypeMap:

export const fieldTypeMap: Record<string, string> = {
  // ... existing entries ...
  boolean: 'boolean',
};

May also need to handle boolean in filter operator selection if Grafana passes boolean values as strings.

主要语言
TypeScript
星标
76
派生
45
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

quickwit-oss/quickwit-datasource 的其他 Issue

查看 quickwit-oss/quickwit-datasource 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。