Skip to content

Commit

Permalink
Merge 63109ef into ac855bf
Browse files Browse the repository at this point in the history
  • Loading branch information
joaopgrassi authored Oct 1, 2024
2 parents ac855bf + 63109ef commit d214b86
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions changelogs/current.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ minor_behavior_changes:

bug_fixes:
# *Changes expected to improve the state of the world and are unlikely to have negative effects*
- area: tracing
change: |
Fixed a bug where the OpenTelemetry tracer exports the OTLP request even when no spans are present.
removed_config_or_runtime:
# *Normally occurs at the end of the* :ref:`deprecation period <deprecated>`
Expand Down
4 changes: 4 additions & 0 deletions source/extensions/tracers/opentelemetry/tracer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ void Tracer::enableTimer() {
}

void Tracer::flushSpans() {
if (span_buffer_.empty()) {
return;
}

ExportTraceServiceRequest request;
// A request consists of ResourceSpans.
::opentelemetry::proto::trace::v1::ResourceSpans* resource_span = request.add_resource_spans();
Expand Down

0 comments on commit d214b86

Please sign in to comment.