Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions generator/apache/apache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ func (m *mockWriter) Write(ctx context.Context, data output.LogRecord) error {
return nil
}

func (m *mockWriter) WriteMetric(_ context.Context, _ output.MetricRecord) error {
return output.ErrUnsupportedTelemetryType
}

func (m *mockWriter) getWrites() [][]byte {
m.mu.Lock()
defer m.mu.Unlock()
Expand Down Expand Up @@ -289,6 +293,10 @@ func (d *discardWriter) Write(ctx context.Context, data output.LogRecord) error
return nil
}

func (d *discardWriter) WriteMetric(_ context.Context, _ output.MetricRecord) error {
return output.ErrUnsupportedTelemetryType
}

func BenchmarkApacheGenerator(b *testing.B) {
logger := zaptest.NewLogger(b)
writer := &discardWriter{}
Expand Down
8 changes: 8 additions & 0 deletions generator/apache_combined/apache_combined_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ func (m *mockWriter) Write(ctx context.Context, data output.LogRecord) error {
return nil
}

func (m *mockWriter) WriteMetric(_ context.Context, _ output.MetricRecord) error {
return output.ErrUnsupportedTelemetryType
}

func (m *mockWriter) getWrites() [][]byte {
m.mu.Lock()
defer m.mu.Unlock()
Expand Down Expand Up @@ -290,6 +294,10 @@ func (d *discardWriter) Write(ctx context.Context, data output.LogRecord) error
return nil
}

func (d *discardWriter) WriteMetric(_ context.Context, _ output.MetricRecord) error {
return output.ErrUnsupportedTelemetryType
}

func BenchmarkApacheCombinedGenerator(b *testing.B) {
logger := zaptest.NewLogger(b)
writer := &discardWriter{}
Expand Down
8 changes: 8 additions & 0 deletions generator/apache_error/apache_error_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ func (m *mockWriter) Write(ctx context.Context, data output.LogRecord) error {
return nil
}

func (m *mockWriter) WriteMetric(_ context.Context, _ output.MetricRecord) error {
return output.ErrUnsupportedTelemetryType
}

func (m *mockWriter) getWrites() [][]byte {
m.mu.Lock()
defer m.mu.Unlock()
Expand Down Expand Up @@ -296,6 +300,10 @@ func (d *discardWriter) Write(ctx context.Context, data output.LogRecord) error
return nil
}

func (d *discardWriter) WriteMetric(_ context.Context, _ output.MetricRecord) error {
return output.ErrUnsupportedTelemetryType
}

func BenchmarkApacheErrorGenerator(b *testing.B) {
logger := zaptest.NewLogger(b)
writer := &discardWriter{}
Expand Down
4 changes: 4 additions & 0 deletions generator/filegen/filegen_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ func (m *mockWriter) Write(ctx context.Context, record output.LogRecord) error {
return nil
}

func (m *mockWriter) WriteMetric(_ context.Context, _ output.MetricRecord) error {
return output.ErrUnsupportedTelemetryType
}

func (m *mockWriter) Close(ctx context.Context) error {
return nil
}
Expand Down
8 changes: 8 additions & 0 deletions generator/json/json_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ func (m *mockWriter) Write(ctx context.Context, data output.LogRecord) error {
return nil
}

func (m *mockWriter) WriteMetric(_ context.Context, _ output.MetricRecord) error {
return output.ErrUnsupportedTelemetryType
}

func (m *mockWriter) getWrites() [][]byte {
m.mu.Lock()
defer m.mu.Unlock()
Expand Down Expand Up @@ -389,6 +393,10 @@ func (d *discardWriter) Write(ctx context.Context, data output.LogRecord) error
return nil
}

func (d *discardWriter) WriteMetric(_ context.Context, _ output.MetricRecord) error {
return output.ErrUnsupportedTelemetryType
}

func BenchmarkGenerateDefaultLog(b *testing.B) {
b.ResetTimer()
for i := 0; i < b.N; i++ {
Expand Down
8 changes: 8 additions & 0 deletions generator/nginx/nginx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ func (m *mockWriter) Write(ctx context.Context, data output.LogRecord) error {
return nil
}

func (m *mockWriter) WriteMetric(_ context.Context, _ output.MetricRecord) error {
return output.ErrUnsupportedTelemetryType
}

func (m *mockWriter) getWrites() [][]byte {
m.mu.Lock()
defer m.mu.Unlock()
Expand Down Expand Up @@ -269,6 +273,10 @@ func (d *discardWriter) Write(ctx context.Context, data output.LogRecord) error
return nil
}

func (d *discardWriter) WriteMetric(_ context.Context, _ output.MetricRecord) error {
return output.ErrUnsupportedTelemetryType
}

func BenchmarkNginxGenerator(b *testing.B) {
logger := zaptest.NewLogger(b)
writer := &discardWriter{}
Expand Down
4 changes: 4 additions & 0 deletions generator/okta/okta_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ func (m *mockWriter) Write(ctx context.Context, data output.LogRecord) error {
return nil
}

func (m *mockWriter) WriteMetric(_ context.Context, _ output.MetricRecord) error {
return output.ErrUnsupportedTelemetryType
}

func (m *mockWriter) getWrites() [][]byte {
m.mu.Lock()
defer m.mu.Unlock()
Expand Down
4 changes: 4 additions & 0 deletions generator/paloalto/paloalto_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ func (m *mockWriter) Write(ctx context.Context, data output.LogRecord) error {
return nil
}

func (m *mockWriter) WriteMetric(_ context.Context, _ output.MetricRecord) error {
return output.ErrUnsupportedTelemetryType
}

func (m *mockWriter) getWrites() [][]byte {
m.mu.Lock()
defer m.mu.Unlock()
Expand Down
8 changes: 8 additions & 0 deletions generator/postgres/postgres_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ func (m *mockWriter) Write(ctx context.Context, data output.LogRecord) error {
return nil
}

func (m *mockWriter) WriteMetric(_ context.Context, _ output.MetricRecord) error {
return output.ErrUnsupportedTelemetryType
}

func (m *mockWriter) getWrites() [][]byte {
m.mu.Lock()
defer m.mu.Unlock()
Expand Down Expand Up @@ -270,6 +274,10 @@ func (d *discardWriter) Write(ctx context.Context, data output.LogRecord) error
return nil
}

func (d *discardWriter) WriteMetric(_ context.Context, _ output.MetricRecord) error {
return output.ErrUnsupportedTelemetryType
}

func BenchmarkPostgresGenerator(b *testing.B) {
logger := zaptest.NewLogger(b)
writer := &discardWriter{}
Expand Down
4 changes: 4 additions & 0 deletions generator/winevt/winevt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ func (m *mockWriter) Write(ctx context.Context, data output.LogRecord) error {
return nil
}

func (m *mockWriter) WriteMetric(_ context.Context, _ output.MetricRecord) error {
return output.ErrUnsupportedTelemetryType
}

func (m *mockWriter) getWrites() [][]byte {
m.mu.Lock()
defer m.mu.Unlock()
Expand Down
6 changes: 5 additions & 1 deletion output/file/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,11 @@ func (f *File) Write(ctx context.Context, data output.LogRecord) error {
}
}

// Stop gracefully stops workers and closes the writer
// WriteMetric is not supported by the file output.
func (f *File) WriteMetric(_ context.Context, _ output.MetricRecord) error {
return output.ErrUnsupportedTelemetryType
}

// SupportedTelemetry returns the telemetry types this output supports.
func (f *File) SupportedTelemetry() []telemetry.Type {
return []telemetry.Type{telemetry.Logs}
Expand Down
5 changes: 5 additions & 0 deletions output/nop/nop.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ func (o *NopOutput) Write(ctx context.Context, data output.LogRecord) error {
return nil
}

// WriteMetric is not supported by the nop output.
func (o *NopOutput) WriteMetric(_ context.Context, _ output.MetricRecord) error {
return output.ErrUnsupportedTelemetryType
}

// Stop performs no work
func (o *NopOutput) Stop(ctx context.Context) error {
o.logger.Info("Stopping NOP output")
Expand Down
Loading