feat: integrate Pulumi event stream with OpenTelemetry for provisioning audit
维护者通常 4 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- go
- 领域
- cloud, devops, observability
调研方向
从 pkg/manager 开始,重点查看 UpStack 和 DestroyStack wrapper,并读取 manager context 中用于 OtelAppCode 和 OtelAuthToken 的字段。跟踪 Pulumi EventStreams 的连接方式,然后定义 event 到 OTel log 的流程以及 exporter 生命周期。当配置了 credentials 后,provisioning 和 decommissioning event 能够带有所列属性被导出,且不需要新增 flags 时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
Summary
Currently, the otelcol-contrib filelog collector runs on the provisioned machine and ships runtime logs (syslog, auth, audit, gitlab-runner) to an OTLP endpoint. However, Pulumi provisioning and decommissioning events are not captured anywhere — meaning there is no audit trail for who created what, when, and whether it succeeded.
This issue tracks integrating the Pulumi Automation API event stream with OpenTelemetry so that stack-up and stack-destroy operations are also exported as OTel log records.
Motivation
For IBM Power and IBM Z targets running in an internal network, auditability of all actions is a hard requirement — not just what runs on the machine, but also the provisioning lifecycle itself. GitLab job logs are already being shipped via otelcol, but the provisioning events that precede and follow any job are currently dark.
Proposed approach
1. Hook into the Pulumi Automation API event stream
auto.Stack.Up() and auto.Stack.Destroy() accept auto.EventStreams(ch), which delivers typed events in real time:
engine.ResourcePreEvent— before a resource operation startsengine.ResourceOutputsEvent— after a resource is created/updatedengine.DiagnosticEvent— log messages from providers/programsengine.SummaryEvent— final outcome (succeeded/failed, duration, resource change counts)engine.CancelEvent— cancellation
2. Convert events to OTel log records
Consume the channel in a goroutine inside pkg/manager (where UpStack/DestroyStack live). Convert each relevant event to an OTel log record using the Go OTel SDK and export directly to the configured --otel-endpoint.
Relevant resource attributes (matching what the filelog collector already attaches):
appcode— from--otel-app-codecom.redhat.otel.auth_token— from--otel-auth-tokenproject-name— from--project-nameoperation—upordestroystack— Pulumi stack name
3. Dependencies
Add to the mapt binary:
go.opentelemetry.io/otelgo.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttpgo.opentelemetry.io/otel/sdk/log
The --otel-* flags are already first-class CLI params on all targets that support otelcol, so no new flags are needed.
4. Integration point
The event consumer would be enabled only when OtelAppCode and OtelAuthToken are set in the mapt context (pkg/manager/context). The manager's UpStack/DestroyStack wrappers are the right place to attach it, keeping the concern isolated from individual provider implementations.
Tradeoffs
| This approach | Current otelcol on machine | |
|---|---|---|
| Captures provisioning events | ✅ | ❌ (machine doesn't exist yet) |
| Captures runtime logs | ❌ | ✅ |
| Requires otelcol on target | No | Yes |
| OTel SDK in mapt binary | Yes | No |
| Needs new flags | No | No |
The two approaches are complementary and can coexist.
Related
- PR adding GitLab runner + otelcol support for IBM Power and IBM Z: #812
- 主要语言
- Go
- 星标
- 25
- 派生
- 41
- 平均合并
- 5 天 3 小时
- 30 天内合并 PR
- 16
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
redhat-developer/mapt 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
redhat-developer/mapt#972 ·
维护者通常 4 天内回复
-
Host/username secret values contain trailing newlines, sanitization fix breaks SSH key可能重新可做 @abdulazeem-tk4vr 于 153 天前认领,目前没有进行中的 PR。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
redhat-developer/mapt#817 · 12 条评论 ·
维护者通常 4 天内回复
-
openshift-snc: align cluster ingress domain with the nip.io access domain (crc.testing split-brain)未关闭
难度 5/5 一周以上 新手友好度 25/100
redhat-developer/mapt#968 · 1 个 reaction ·
维护者通常 4 天内回复
-
[enhancement] github runner: support just-in-time (JIT) runner configuration可能已有人在做 @atishay-kasliwal 于 1 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 48/100
redhat-developer/mapt#957 · 1 条评论 ·
维护者通常 4 天内回复
-
enhancement provider/IBMCLOUD
难度 4/5 3-5 天 新手友好度 25/100
redhat-developer/mapt#955 ·
维护者通常 4 天内回复
查看 redhat-developer/mapt 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 66/100
v2fly/domain-list-community#4307 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 86/100
维护者通常 1 天内回复
-
chore needs-triage
难度 1/5 1 小时以内 新手友好度 88/100
seanb4t/codegraph-go#380 ·
维护者通常 1 天内回复
-
notify: voice_queue rows are deleted only at startup, so a hub that stays up grows it without bound未关闭
难度 2/5 1-3 小时 新手友好度 72/100
mattabate/life-distributable#232 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 86/100
维护者通常 1 天内回复