feat: integrate Pulumi event stream with OpenTelemetry for provisioning audit
Maintainers usually reply within 3 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- go
- Domain
- cloud, devops, observability
Research direction
Start in pkg/manager, especially the UpStack and DestroyStack wrappers, and read the manager context fields for OtelAppCode and OtelAuthToken. Trace how Pulumi EventStreams are attached, then define the event-to-OTel log flow and exporter lifecycle. Done means provisioning and decommissioning events are exported with the listed attributes when credentials are configured, without requiring new flags.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- Go
- Stars
- 26
- Forks
- 41
- Avg merge
- 3d 14h
- Merged PRs (30d)
- 27
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from redhat-developer/mapt
-
kind: v0.14.7 control-plane readiness block reads the wrong kubeconfig path (provision always fails)Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
redhat-developer/mapt#997 ·
Maintainers usually reply within 3 days
-
Host/username secret values contain trailing newlines, sanitization fix breaks SSH keyMay be free again @abdulazeem-tk4vr claimed this 167 days ago, and no pull request is open. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
redhat-developer/mapt#817 · 12 comments ·
Maintainers usually reply within 3 days
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
redhat-developer/mapt#991 ·
Maintainers usually reply within 3 days
-
enhancement provider/AWS provider/IBMCLOUD target/openshift-snc
Difficulty 4/5 3-5 days Newbie friendliness 57/100
redhat-developer/mapt#990 ·
Maintainers usually reply within 3 days
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
redhat-developer/mapt#974 ·
Maintainers usually reply within 3 days
All issues in redhat-developer/mapt
Similar issues
-
effort:s impact:low raised-by:reviewer risk:low
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
medici-finance/assay#8050 · 1 comment ·
Maintainers usually reply within 1 day
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
factory:subtask
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
Maintainers usually reply within 1 day
-
enhancement needs-triage service/licensemanager
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
hashicorp/terraform-provider-aws#51503 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100