Skip to content

Commit

Permalink
[awsfirehosereceiver/cwlogs] Correct comments
Browse files Browse the repository at this point in the history
  • Loading branch information
gavincabbage committed Oct 1, 2024
1 parent b4b04dc commit dc50db2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package unmarshalertest // import "github.com/open-telemetry/opentelemetry-colle

import (
"go.opentelemetry.io/collector/pdata/plog"

"github.com/open-telemetry/opentelemetry-collector-contrib/receiver/awsfirehosereceiver/internal/unmarshaler"
)

Expand All @@ -18,13 +18,13 @@ type NopLogsUnmarshaler struct {

var _ unmarshaler.LogsUnmarshaler = (*NopLogsUnmarshaler)(nil)

// NewNopMetrics provides a nop logs unmarshaler with the default
// NewNopLogs provides a nop logs unmarshaler with the default
// plog.Logs and no error.
func NewNopLogs() *NopLogsUnmarshaler {
return &NopLogsUnmarshaler{}
}

// NewWithMetrics provides a nop logs unmarshaler with the passed
// NewWithLogs provides a nop logs unmarshaler with the passed
// in logs as the result of the Unmarshal and no error.
func NewWithLogs(logs plog.Logs) *NopLogsUnmarshaler {
return &NopLogsUnmarshaler{logs: logs}
Expand Down
7 changes: 3 additions & 4 deletions receiver/awsfirehosereceiver/logs_receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import (
const defaultLogsRecordType = cwlog.TypeStr

// The logsConsumer implements the firehoseConsumer
// to use a metrics consumer and unmarshaler.
// to use a logs consumer and unmarshaler.
type logsConsumer struct {
// consumer passes the translated metrics on to the
// consumer passes the translated logs on to the
// next consumer.
consumer consumer.Logs
// unmarshaler is the configured LogsUnmarshaler
Expand Down Expand Up @@ -60,8 +60,7 @@ func newLogsReceiver(
}

// Consume uses the configured unmarshaler to deserialize the records into a
// single pmetric.Metrics. If there are common attributes available, then it will
// attach those to each of the pcommon.Resources. It will send the final result
// single plog.Logs. It will send the final result
// to the next consumer.
func (mc *logsConsumer) Consume(ctx context.Context, records [][]byte, commonAttributes map[string]string) (int, error) {
md, err := mc.unmarshaler.Unmarshal(records)
Expand Down

0 comments on commit dc50db2

Please sign in to comment.