From 30c10cc77cd3a6d9583c2339ade689d06585aba4 Mon Sep 17 00:00:00 2001 From: Dino Oliva Date: Wed, 5 Sep 2018 12:09:44 -0700 Subject: Spring sleuth (#1378) * Initial import of OpenCensus/Sleuth integration. * Minor fixes for integration with master. * Adds a README. * Removes hardcoded dependencies in build file. * Adds contrib to spring_sleuth file path. * Updates package names appropriately based on file renames. * Fixes build paths. * Fixes for build checks. * Mark as experimental. * Minor fixes for build files (space vs tab). * Minor fixes for build files (space vs tab). * Update README to absolve Spring Sleuth team of any responsibility for this spring_sleuth plugin. * Minor fixes for import control (space vs tab). * Tag public classes @since 0.16 * Adds javadoc for public methods not already documented. * Updates OpenCensusSleuthTracer to pass nullness checks. * Fixes for formatting issues. * Fixes for typos. * Suppresses the check return value warning added by gRPC. * Suppresses the check return value warning added by gRPC. --- .../stubs/org-springframework-cloud-sleuth.astub | 19 +++++++++++++++++++ .../stubs/org-springframework-cloud-sleuth.log.astub | 9 +++++++++ 2 files changed, 28 insertions(+) create mode 100644 checker-framework/stubs/org-springframework-cloud-sleuth.astub create mode 100644 checker-framework/stubs/org-springframework-cloud-sleuth.log.astub (limited to 'checker-framework') diff --git a/checker-framework/stubs/org-springframework-cloud-sleuth.astub b/checker-framework/stubs/org-springframework-cloud-sleuth.astub new file mode 100644 index 00000000..61d2fa11 --- /dev/null +++ b/checker-framework/stubs/org-springframework-cloud-sleuth.astub @@ -0,0 +1,19 @@ +package org.springframework.cloud.sleuth; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.springframework.cloud.sleuth.Sampler; +import org.springframework.cloud.sleuth.Span; + +interface Tracer { + @Nullable Span close(@Nullable Span span); + @Nullable Span continueSpan(@Nullable Span span); + @Nullable Span createSpan(String name); + @Nullable Span createSpan(String name, @Nullable Sampler sampler); + @Nullable Span createSpan(String name, @Nullable Span parent); + @Nullable Span detach(@Nullable Span span); + @Nullable Span getCurrentSpan(); +} + +class Span { + Span (Span span, @Nullable Span parent); +} diff --git a/checker-framework/stubs/org-springframework-cloud-sleuth.log.astub b/checker-framework/stubs/org-springframework-cloud-sleuth.log.astub new file mode 100644 index 00000000..9497f6f2 --- /dev/null +++ b/checker-framework/stubs/org-springframework-cloud-sleuth.log.astub @@ -0,0 +1,9 @@ +package org.springframework.cloud.sleuth.log; + +import org.checkerframework.checker.nullness.qual.Nullable; +import org.springframework.cloud.sleuth.Span; + +interface SpanLogger { + void logStartedSpan(@Nullable Span parent, Span span); + void logStoppedSpan(@Nullable Span parent, Span span); +} -- cgit v1.2.3