Skip to content

Commit

Permalink
chore
Browse files Browse the repository at this point in the history
Signed-off-by: Bence Csati <bence.csati@axoflow.com>
  • Loading branch information
csatib02 committed Dec 4, 2024
1 parent 9dbb6dd commit 419cd55
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
13 changes: 6 additions & 7 deletions exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (

fclient "github.com/IBM/fluent-forward-go/fluent/client"
"github.com/IBM/fluent-forward-go/fluent/protocol"
fproto "github.com/IBM/fluent-forward-go/fluent/protocol"
"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/pdata/pcommon"
"go.opentelemetry.io/collector/pdata/plog"
Expand Down Expand Up @@ -87,7 +86,7 @@ func (f *fluentforwardExporter) connectForward() {

func (f *fluentforwardExporter) pushLogData(ctx context.Context, ld plog.Logs) error {
// move for loops into a translator
entries := []fproto.EntryExt{}
entries := []protocol.EntryExt{}
rls := ld.ResourceLogs()
for i := 0; i < rls.Len(); i++ {
ills := rls.At(i).ScopeLogs()
Expand All @@ -96,8 +95,8 @@ func (f *fluentforwardExporter) pushLogData(ctx context.Context, ld plog.Logs) e
logs := ills.At(j).LogRecords()
for k := 0; k < logs.Len(); k++ {
log := logs.At(k)
entry := fproto.EntryExt{
Timestamp: fproto.EventTimeNow(),
entry := protocol.EntryExt{
Timestamp: protocol.EventTimeNow(),
Record: f.convertLogToMap(log, rls.At(i)),
}
entries = append(entries, entry)
Expand Down Expand Up @@ -176,7 +175,7 @@ func (f *fluentforwardExporter) convertLogToMap(lr plog.LogRecord, res plog.Reso

type sendFunc func(string, protocol.EntryList) error

func (f *fluentforwardExporter) send(sendMethod sendFunc, entries []fproto.EntryExt) error {
func (f *fluentforwardExporter) send(sendMethod sendFunc, entries []protocol.EntryExt) error {
err := sendMethod(f.config.Tag, entries)
// sometimes the connection is lost, we try to reconnect and send the data again
if err != nil {
Expand All @@ -193,10 +192,10 @@ func (f *fluentforwardExporter) send(sendMethod sendFunc, entries []fproto.Entry
return nil
}

func (f *fluentforwardExporter) sendCompressed(entries []fproto.EntryExt) error {
func (f *fluentforwardExporter) sendCompressed(entries []protocol.EntryExt) error {
return f.send(f.client.SendCompressed, entries)
}

func (f *fluentforwardExporter) sendForward(entries []fproto.EntryExt) error {
func (f *fluentforwardExporter) sendForward(entries []protocol.EntryExt) error {
return f.send(f.client.SendForward, entries)
}
2 changes: 1 addition & 1 deletion factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func createLogsExporter(ctx context.Context, set exporter.Settings, config compo
exporterConfig := config.(*Config)
exp := newExporter(exporterConfig, set.TelemetrySettings)

return exporterhelper.NewLogsExporter(
return exporterhelper.NewLogs(
ctx,
set,
config,
Expand Down

0 comments on commit 419cd55

Please sign in to comment.