Skip to content

Streaming Exporters Support#203

Open
mbolt35 wants to merge 1 commit into
developfrom
bolt/streaming-exporters
Open

Streaming Exporters Support#203
mbolt35 wants to merge 1 commit into
developfrom
bolt/streaming-exporters

Conversation

@mbolt35

@mbolt35 mbolt35 commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator
  • Update opencost version
  • Add streaming exporters support via environment variable
  • Add compression for streaming exporters

// if the level provided is invalid (explicitly set, but not in the 0-9 range),
// the more "acceptable" default for our use-case is speed.
if !level.IsValid() {
return exporter.ExportCompressionLevelBestSpeed

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a debug-level log if the user provided an invalid compression level?

Comment thread kubecost/emitter.go
Comment on lines +97 to +98
pipelineConfig.Streaming = ke.config.StreamingExportEnabled
pipelineConfig.Compression = ke.config.StreamingExportCompressionLevel

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the user did enable streaming, add a log?

Suggested change
pipelineConfig.Streaming = ke.config.StreamingExportEnabled
pipelineConfig.Compression = ke.config.StreamingExportCompressionLevel
pipelineConfig.Streaming = ke.config.StreamingExportEnabled
pipelineConfig.Compression = ke.config.StreamingExportCompressionLevel
if ke.config.StreamingExportEnabled {
log.Infof("Streaming export enabled with compression level: %d", ke.config.StreamingExportCompressionLevel)
}

Comment thread kubecost/config_test.go

for _, c := range cases {
t.Run(fmt.Sprintf("streaming and compression config stream=%s level=%s", c.isStreaming, c.compressionLevel), func(t *testing.T) {
tempDir := os.TempDir()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
tempDir := os.TempDir()
tempDir := t.TempDir()

@thomasvn thomasvn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comments about logging, looks good!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants