Skip to content

Conversation

@denis256
Copy link
Member

@denis256 denis256 commented Jan 9, 2026

Description

  • updated dependency of otlpmetrichttp
  • in case of console output - use simple span processor

Fixes #5325.

TODOs

Read the Gruntwork contribution guidelines.

  • I authored this code entirely myself
  • I am submitting code based on open source software (e.g. MIT, MPL-2.0, Apache)]
  • I am adding or upgrading a dependency or adapted code and confirm it has a compatible open source license
  • Update the docs.
  • Run the relevant tests successfully, including pre-commit checks.
  • Include release notes. If this PR is backward incompatible, include a migration guide.

Release Notes (draft)

Added / Removed / Updated [X].

Migration Guide

Summary by CodeRabbit

  • New Features

    • Enhanced telemetry tracing with configurable trace exporters
    • Improved trace processing with dynamic processor selection based on configuration
  • Tests

    • Added integration test validating telemetry trace output and trace relationship data

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel
Copy link

vercel bot commented Jan 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
terragrunt-docs Ready Ready Preview, Comment Jan 12, 2026 5:18pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 9, 2026

📝 Walkthrough

Walkthrough

This PR fixes the non-functional console trace exporter by updating trace provider initialization to dynamically select the appropriate SpanProcessor based on exporter type. The SimpleSpanProcessor is used for console exports, while BatchSpanProcessor is used for others. Dependencies are also updated.

Changes

Cohort / File(s) Summary
Dependency Updates
go.mod
Updated go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp to v1.39.0 and golang.org/x/sys to v0.40.0
Trace Provider Configuration
telemetry/tracer.go
Modified newTraceProvider to accept Options pointer and dynamically select SpanProcessor: SimpleSpanProcessor for console exporter, BatchSpanProcessor otherwise. Updated NewTracer to pass options through.
Integration Testing
test/integration_serial_test.go
Added TestTerragruntTelemetryTraces to validate console trace exporter functionality by verifying span trace indicators and parent fields in output.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested reviewers

  • wakeful
  • levkohimins
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix: traces output in console mode' clearly and concisely describes the main change—fixing console trace output functionality—which aligns with the primary objective of enabling console trace exporter to display traces in JSON format.
Description check ✅ Passed The description covers the main changes (dependency update and span processor switch) and references the linked issue #5325, though it lacks detailed release notes and migration guide content as specified in the template.
Linked Issues check ✅ Passed The code changes directly address issue #5325 by updating dependencies and modifying the span processor logic to use SimpleSpanProcessor for console output, which enables console trace exporter to display traces in JSON format as expected.
Out of Scope Changes check ✅ Passed All code changes are directly related to fixing the console trace exporter issue; the dependency updates, span processor modifications, and integration test additions are all within scope of issue #5325.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ae3bbe5 and a1153c2.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (3)
  • go.mod
  • telemetry/tracer.go
  • test/integration_serial_test.go
🧰 Additional context used
📓 Path-based instructions (1)
**/*.go

⚙️ CodeRabbit configuration file

Review the Go code for quality and correctness. Make sure that the Go code follows best practices, is performant, and is easy to understand and maintain.

Files:

  • test/integration_serial_test.go
  • telemetry/tracer.go
🧬 Code graph analysis (2)
test/integration_serial_test.go (1)
test/helpers/package.go (2)
  • CleanupTerraformFolder (956-963)
  • CopyEnvironment (91-111)
telemetry/tracer.go (1)
telemetry/opts.go (1)
  • Options (4-17)
🔇 Additional comments (5)
go.mod (2)

73-73: LGTM!

Standard minor version bump for golang.org/x/sys.


61-61: Dependency version alignment is correct. The otlpmetrichttp package is now aligned with other OpenTelemetry core packages at v1.39.0, and this version exists on pkg.go.dev. This is a consistent minor version bump with no security advisories against the core package.

test/integration_serial_test.go (1)

816-829: LGTM!

This test validates the fix for issue #5325 by verifying that the console trace exporter outputs span traces. The test pattern is consistent with other telemetry tests in this file, and appropriately avoids parallel execution due to environment variable modification.

telemetry/tracer.go (2)

55-55: LGTM!

Passing opts to newTraceProvider is necessary to determine the exporter type for processor selection.


128-138: Correct fix for console trace exporter.

The processor selection logic is appropriate:

This aligns with OpenTelemetry best practices where SimpleSpanProcessor is recommended for development/debugging scenarios (like console output) while BatchSpanProcessor is preferred for production exporters.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Terragrunt 0.97.1 TG_TELEMETRY_TRACE_EXPORTER=console is not working

2 participants