Skip to content

Commit

Permalink
Force the telemetry to be sent to azuremonitor
Browse files Browse the repository at this point in the history
Signed-off-by: whitneygriffith <[email protected]>
  • Loading branch information
whitneygriffith committed Nov 4, 2024
1 parent 0a6bb8a commit 2e00366
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions exporter/azuremonitorexporter/channels.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ import "github.com/microsoft/ApplicationInsights-Go/appinsights/contracts"

type transportChannel interface {
Send(*contracts.Envelope)
Flush()
}
3 changes: 2 additions & 1 deletion exporter/azuremonitorexporter/logexporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ func (exporter *logExporter) onLogData(_ context.Context, logData plog.Logs) err
}
}
}

// Flush the transport channel to force the telemetry to be sent
exporter.transportChannel.Flush()
return nil
}

Expand Down
2 changes: 2 additions & 0 deletions exporter/azuremonitorexporter/metricexporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ func (exporter *metricExporter) onMetricData(_ context.Context, metricData pmetr
}
}

// Flush the transport channel to force the telemetry to be sent
exporter.transportChannel.Flush()
return nil
}

Expand Down
2 changes: 2 additions & 0 deletions exporter/azuremonitorexporter/traceexporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ func (v *traceVisitor) visit(
v.exporter.transportChannel.Send(envelope)
}

// Flush the transport channel to force the telemetry to be sent
v.exporter.transportChannel.Flush()
v.processed++

return true
Expand Down

0 comments on commit 2e00366

Please sign in to comment.