Skip to content

Commit

Permalink
Merge pull request #622 from michaelgoin/stop-streaming-send-call
Browse files Browse the repository at this point in the history
Stops calling send() on streaming span aggregator on initial harvest.
  • Loading branch information
carlo-808 authored Feb 23, 2021
2 parents a376993 + 95d33be commit 02e0e45
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 5 additions & 2 deletions lib/agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,11 @@ Agent.prototype.forceHarvestAll = function forceHarvestAll(callback) {
promises.push(metricPromise)

// TODO: plumb config through to aggregators so they can do their own checking.
if (agent.config.distributed_tracing.enabled &&
agent.config.span_events.enabled) {
if (
agent.config.distributed_tracing.enabled &&
agent.config.span_events.enabled &&
!agent.spanEventAggregator.isStream // Not valid to send on streaming aggregator
) {
const spanPromise = new Promise((resolve) => {
agent.spanEventAggregator.once(
'finished span_event_data data send.',
Expand Down
2 changes: 0 additions & 2 deletions lib/spans/streaming-span-event-aggregator.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ class StreamingSpanEventAggregator extends Aggregator {
}

send() {
// Only log once started. This will get invoked on initial harvest
// prior to start which we'll just ignore.
if (this.started) {
logger.warnOnce('SEND_WARNING', SEND_WARNING)
}
Expand Down

0 comments on commit 02e0e45

Please sign in to comment.