span_exporter.go 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // Copyright The OpenTelemetry Authors
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. package trace // import "go.opentelemetry.io/otel/sdk/trace"
  15. import "context"
  16. // SpanExporter handles the delivery of spans to external receivers. This is
  17. // the final component in the trace export pipeline.
  18. type SpanExporter interface {
  19. // DO NOT CHANGE: any modification will not be backwards compatible and
  20. // must never be done outside of a new major release.
  21. // ExportSpans exports a batch of spans.
  22. //
  23. // This function is called synchronously, so there is no concurrency
  24. // safety requirement. However, due to the synchronous calling pattern,
  25. // it is critical that all timeouts and cancellations contained in the
  26. // passed context must be honored.
  27. //
  28. // Any retry logic must be contained in this function. The SDK that
  29. // calls this function will not implement any retry logic. All errors
  30. // returned by this function are considered unrecoverable and will be
  31. // reported to a configured error Handler.
  32. ExportSpans(ctx context.Context, spans []ReadOnlySpan) error
  33. // DO NOT CHANGE: any modification will not be backwards compatible and
  34. // must never be done outside of a new major release.
  35. // Shutdown notifies the exporter of a pending halt to operations. The
  36. // exporter is expected to perform any cleanup or synchronization it
  37. // requires while honoring all timeouts and cancellations contained in
  38. // the passed context.
  39. Shutdown(ctx context.Context) error
  40. // DO NOT CHANGE: any modification will not be backwards compatible and
  41. // must never be done outside of a new major release.
  42. }