diff --git a/1.0.x/index.html b/1.0.x/index.html index e210a91b4..4f311d3eb 100644 --- a/1.0.x/index.html +++ b/1.0.x/index.html @@ -9,7 +9,7 @@ Spring Cloud Sleuth - + + + + + + Click here if you are not redirected. + diff --git a/js/backbone.js b/js/backbone.js index 3512d42fb..7197d6466 100644 --- a/js/backbone.js +++ b/js/backbone.js @@ -3,7 +3,7 @@ // (c) 2010-2013 Jeremy Ashkenas, DocumentCloud Inc. // Backbone may be freely distributed under the MIT license. // For all details and documentation: -// http://backbonejs.org +// https://backbonejs.org (function(){ @@ -1298,7 +1298,7 @@ // ---------------- // Handles cross-browser history management, based on either - // [pushState](http://diveintohtml5.info/history.html) and real URLs, or + // [pushState](https://diveintohtml5.info/history.html) and real URLs, or // [onhashchange](https://developer.mozilla.org/en-US/docs/DOM/window.onhashchange) // and URL fragments. If the browser supports neither (old IE, natch), // falls back to polling. diff --git a/js/highlight/styles/dracula.min.css b/js/highlight/styles/dracula.min.css index d591db680..578f0b40d 100644 --- a/js/highlight/styles/dracula.min.css +++ b/js/highlight/styles/dracula.min.css @@ -7,7 +7,7 @@ https://github.com/zenorocha/dracula-theme Copyright 2015, All rights reserved Code licensed under the MIT license -http://zenorocha.mit-license.org +https://zenorocha.mit-license.org/ @author Éverton Ribeiro @author Zeno Rocha diff --git a/js/highlight/styles/monokai-sublime.min.css b/js/highlight/styles/monokai-sublime.min.css index 2864170da..ed52c92eb 100644 --- a/js/highlight/styles/monokai-sublime.min.css +++ b/js/highlight/styles/monokai-sublime.min.css @@ -1,6 +1,6 @@ /* -Monokai Sublime style. Derived from Monokai by noformnocontent http://nn.mit-license.org/ +Monokai Sublime style. Derived from Monokai by noformnocontent https://nn.mit-license.org/ */ diff --git a/js/highlight/styles/monokai.min.css b/js/highlight/styles/monokai.min.css index 775d53f91..a57355857 100644 --- a/js/highlight/styles/monokai.min.css +++ b/js/highlight/styles/monokai.min.css @@ -1,5 +1,5 @@ /* -Monokai style - ported by Luigi Maselli - http://grigio.org +Monokai style - ported by Luigi Maselli - https://grigio.org */ .hljs { diff --git a/js/jquery.js b/js/jquery.js index 6f8c96758..891815088 100644 --- a/js/jquery.js +++ b/js/jquery.js @@ -1,13 +1,13 @@ /*! * jQuery JavaScript Library v1.10.1 - * http://jquery.com/ + * https://jquery.com/ * * Includes Sizzle.js - * http://sizzlejs.com/ + * https://sizzlejs.com/ * * Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors * Released under the MIT license - * http://jquery.org/license + * https://jquery.org/license * * Date: 2013-05-30T21:49Z */ @@ -561,7 +561,7 @@ jQuery.extend({ if ( data ) { // Make sure the incoming data is actual JSON - // Logic borrowed from http://json.org/json2.js + // Logic borrowed from https://json.org/json2.js if ( rvalidchars.test( data.replace( rvalidescape, "@" ) .replace( rvalidtokens, "]" ) .replace( rvalidbraces, "")) ) { @@ -602,7 +602,7 @@ jQuery.extend({ // Evaluates a script in a global context // Workarounds based on findings by Jim Driscoll - // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context + // https://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context globalEval: function( data ) { if ( data && jQuery.trim( data ) ) { // We use execScript on Internet Explorer @@ -921,7 +921,7 @@ jQuery.ready.promise = function( obj ) { // Catch cases where $(document).ready() is called after the browser event has already occurred. // we once tried to use readyState "interactive" here, but it caused issues like the one - // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 + // discovered by ChrisS here: https://bugs.jquery.com/ticket/12282#comment:15 if ( document.readyState === "complete" ) { // Handle it asynchronously to allow scripts the opportunity to delay ready setTimeout( jQuery.ready ); @@ -1001,11 +1001,11 @@ function isArraylike( obj ) { rootjQuery = jQuery(document); /*! * Sizzle CSS Selector Engine v1.9.4-pre - * http://sizzlejs.com/ + * https://sizzlejs.com/ * * Copyright 2013 jQuery Foundation, Inc. and other contributors * Released under the MIT license - * http://jquery.org/license + * https://jquery.org/license * * Date: 2013-05-27 */ @@ -1069,17 +1069,17 @@ var i, // Regular expressions - // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace + // Whitespace characters https://www.w3.org/TR/css3-selectors/#whitespace whitespace = "[\\x20\\t\\r\\n\\f]", - // http://www.w3.org/TR/css3-syntax/#characters + // https://www.w3.org/TR/css3-syntax/#characters characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", // Loosely modeled on CSS identifier characters - // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors - // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier + // An unquoted value should be a CSS identifier https://www.w3.org/TR/css3-selectors/#attribute-selectors + // Proper syntax: https://www.w3.org/TR/CSS21/syndata.html#value-def-identifier identifier = characterEncoding.replace( "w", "w#" ), - // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors + // Acceptable operators https://www.w3.org/TR/selectors/#attribute-selectors attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace + "*(?:([*^$|!~]?=)" + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]", @@ -1129,7 +1129,7 @@ var i, rescape = /'|\\/g, - // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters + // CSS escapes https://www.w3.org/TR/CSS21/syndata.html#escaped-characters runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), funescape = function( _, escaped, escapedWhitespace ) { var high = "0x" + escaped - 0x10000; @@ -1376,7 +1376,7 @@ function boolHandler( elem, name ) { /** * Fetches attributes without interpolation - * http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx + * https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx * @param {Element} elem * @param {String} name */ @@ -1653,7 +1653,7 @@ setDocument = Sizzle.setDocument = function( node ) { // We allow this because of a bug in IE8/9 that throws an error // whenever `document.activeElement` is accessed on an iframe // So, we allow :focus to pass through QSA all the time to avoid the IE error - // See http://bugs.jquery.com/ticket/13378 + // See https://bugs.jquery.com/ticket/13378 rbuggyQSA = []; if ( (support.qsa = isNative(doc.querySelectorAll)) ) { @@ -1664,7 +1664,7 @@ setDocument = Sizzle.setDocument = function( node ) { // This is to test IE's treatment of not explicitly // setting a boolean content attribute, // since its presence should be enough - // http://bugs.jquery.com/ticket/12359 + // https://bugs.jquery.com/ticket/12359 div.innerHTML = ""; // Support: IE8 @@ -1674,7 +1674,7 @@ setDocument = Sizzle.setDocument = function( node ) { } // Webkit/Opera - :checked should return selected option elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + // https://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked // IE8 throws error here and will not see later tests if ( !div.querySelectorAll(":checked").length ) { rbuggyQSA.push(":checked"); @@ -2219,7 +2219,7 @@ Expr = Sizzle.selectors = { "PSEUDO": function( pseudo, argument ) { // pseudo-class names are case-insensitive - // http://www.w3.org/TR/selectors/#pseudo-classes + // https://www.w3.org/TR/selectors/#pseudo-classes // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters // Remember that setFilters inherits from pseudos var args, @@ -2303,7 +2303,7 @@ Expr = Sizzle.selectors = { // or beginning with the identifier C immediately followed by "-". // The matching of C against the element's language value is performed case-insensitively. // The identifier C does not have to be a valid language name." - // http://www.w3.org/TR/selectors/#lang-pseudo + // https://www.w3.org/TR/selectors/#lang-pseudo "lang": markFunction( function( lang ) { // lang value must be a valid identifier if ( !ridentifier.test(lang || "") ) { @@ -2350,7 +2350,7 @@ Expr = Sizzle.selectors = { "checked": function( elem ) { // In CSS3, :checked should return both checked and selected elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + // https://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked var nodeName = elem.nodeName.toLowerCase(); return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); }, @@ -2367,7 +2367,7 @@ Expr = Sizzle.selectors = { // Contents "empty": function( elem ) { - // http://www.w3.org/TR/selectors/#empty-pseudo + // https://www.w3.org/TR/selectors/#empty-pseudo // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)), // not comment, processing instructions, or others // Thanks to Diego Perini for the nodeName shortcut @@ -4024,7 +4024,7 @@ jQuery.fn.extend({ }); }, // Based off of the plugin by Clint Helfers, with permission. - // http://blindsignals.com/index.php/2009/07/jquery-delay/ + // http://blindsignals.com delay: function( time, type ) { time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; type = type || "fx"; @@ -4501,7 +4501,7 @@ jQuery.extend({ tabIndex: { get: function( elem ) { // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set - // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ + // https://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ // Use proper attribute retrieval(#12072) var tabindex = jQuery.find.attr( elem, "tabindex" ); @@ -4641,7 +4641,7 @@ if ( !getSetAttribute ) { // Some attributes require a special call on IE -// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx +// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx if ( !jQuery.support.hrefNormalized ) { // href/src property should get the full normalized URL (#10299/#12915) jQuery.each([ "href", "src" ], function( i, name ) { @@ -5413,7 +5413,7 @@ jQuery.Event = function( src, props ) { }; // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding -// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html jQuery.Event.prototype = { isDefaultPrevented: returnFalse, isPropagationStopped: returnFalse, @@ -6516,7 +6516,7 @@ jQuery.extend({ if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) && (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) { - // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 + // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2 destElements = getAll( clone ); srcElements = getAll( elem ); @@ -7120,7 +7120,7 @@ if ( window.getComputedStyle ) { // A tribute to the "awesome hack by Dean Edwards" // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels - // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values + // this is against the CSSOM draft spec: https://dev.w3.org/csswg/cssom/#resolved-values if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) { // Remember the original values @@ -8729,7 +8729,7 @@ if ( xhrSupported ) { // Firefox throws exceptions when accessing properties // of an xhr when a network error occurred - // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE) + // https://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE) try { // Was never called and is aborted or complete diff --git a/js/test/SpecRunner.html b/js/test/SpecRunner.html index 877cfa2b4..66bdd3b6a 100644 --- a/js/test/SpecRunner.html +++ b/js/test/SpecRunner.html @@ -4,7 +4,7 @@ title: Your Project Name Here --- + "https://www.w3.org/TR/html4/loose.dtd"> Jasmine Spec Runner diff --git a/js/test/lib/support/mock-ajax.js b/js/test/lib/support/mock-ajax.js index 5c99627ae..bf17886fc 100644 --- a/js/test/lib/support/mock-ajax.js +++ b/js/test/lib/support/mock-ajax.js @@ -4,9 +4,9 @@ Supports both Prototype.js and jQuery. - http://github.com/pivotal/jasmine-ajax + https://github.com/pivotal/jasmine-ajax - Jasmine Home page: http://pivotal.github.com/jasmine + Jasmine Home page: https://pivotal.github.com/jasmine Copyright (c) 2008-2010 Pivotal Labs diff --git a/js/test/spec/QuickStartWidgetSpec.js b/js/test/spec/QuickStartWidgetSpec.js index b5587776a..3bafa1d04 100644 --- a/js/test/spec/QuickStartWidgetSpec.js +++ b/js/test/spec/QuickStartWidgetSpec.js @@ -6,18 +6,18 @@ describe("QuickStartWidget", function () { var project = new Spring.Project({ "id": "spring-data-jpa", "name": "Spring Data JPA", - "repoUrl": "http://github.com/SpringSource/spring-data-jpa", - "siteUrl": "http://projects.spring.io/spring-data-jpa", + "repoUrl": "https://github.com/SpringSource/spring-data-jpa", + "siteUrl": "https://projects.spring.io/spring-data-jpa", "projectReleases": [ { - "refDocUrl": "http://docs.spring.io/spring-data/jpa/docs/1.4.0.RC1/reference/html/", - "apiDocUrl": "http://docs.spring.io/spring-data/jpa/docs/1.4.0.RC1/api/", + "refDocUrl": "https://docs.spring.io/spring-data/jpa/docs/1.4.0.RC1/reference/html/", + "apiDocUrl": "https://docs.spring.io/spring-data/jpa/docs/1.4.0.RC1/api/", "groupId": "org.springframework.data", "artifactId": "spring-data-jpa", "repository": { "id": "spring-milestones", "name": "Spring Milestones", - "url": "http://repo.spring.io/milestone", + "url": "https://repo.spring.io/milestone", "snapshotsEnabled": false }, "version": "1.4.0.RC1", @@ -28,8 +28,8 @@ describe("QuickStartWidget", function () { "versionDisplayName": "1.4.0.RC1" }, { - "refDocUrl": "http://docs.spring.io/spring-data/jpa/docs/1.3.4.RELEASE/reference/html/", - "apiDocUrl": "http://docs.spring.io/spring-data/jpa/docs/1.3.4.RELEASE/api/", + "refDocUrl": "https://docs.spring.io/spring-data/jpa/docs/1.3.4.RELEASE/reference/html/", + "apiDocUrl": "https://docs.spring.io/spring-data/jpa/docs/1.3.4.RELEASE/api/", "groupId": "org.springframework.data", "artifactId": "spring-data-jpa", "repository": null, @@ -73,7 +73,7 @@ describe("QuickStartWidget", function () { expect($('#maven_widget')).toContainText("spring-milestones"); expect($('#maven_widget')).toContainText("Spring Milestones"); - expect($('#maven_widget')).toContainText("http://repo.spring.io/milestone"); + expect($('#maven_widget')).toContainText("https://repo.spring.io/milestone"); expect($('#maven_widget')).toContainText("false"); }); @@ -83,7 +83,7 @@ describe("QuickStartWidget", function () { expect($('#maven_widget')).not.toContainText("repository"); expect($('#maven_widget')).not.toContainText("spring-milestones"); expect($('#maven_widget')).not.toContainText("Spring Milestones"); - expect($('#maven_widget')).not.toContainText("http://repo.spring.io/milestone"); + expect($('#maven_widget')).not.toContainText("https://repo.spring.io/milestone"); expect($('#maven_widget')).not.toContainText("false"); }); }); @@ -102,7 +102,7 @@ describe("QuickStartWidget", function () { $('#jasmine_content select').val(0).change(); expect($('#maven_widget')).toContainText("repositories"); - expect($('#maven_widget')).toContainText("http://repo.spring.io/milestone"); + expect($('#maven_widget')).toContainText("https://repo.spring.io/milestone"); }); }); }); diff --git a/js/underscore.js b/js/underscore.js index 7d4ee27c7..f5df8e031 100644 --- a/js/underscore.js +++ b/js/underscore.js @@ -1,5 +1,5 @@ // Underscore.js 1.5.1 -// http://underscorejs.org +// https://underscorejs.org // (c) 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors // Underscore may be freely distributed under the MIT license. @@ -554,7 +554,7 @@ // Generate an integer Array containing an arithmetic progression. A port of // the native Python `range()` function. See - // [the Python documentation](http://docs.python.org/library/functions.html#range). + // [the Python documentation](https://docs.python.org/library/functions.html#range). _.range = function(start, stop, step) { if (arguments.length <= 1) { stop = start || 0; @@ -844,7 +844,7 @@ // Internal recursive comparison function for `isEqual`. var eq = function(a, b, aStack, bStack) { // Identical objects are equal. `0 === -0`, but they aren't identical. - // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal). + // See the [Harmony `egal` proposal](https://wiki.ecmascript.org/doku.php?id=harmony:egal). if (a === b) return a !== 0 || 1 / a == 1 / b; // A strict comparison is necessary because `null == undefined`. if (a == null || b == null) return a === b; diff --git a/multi/_integrations.html b/multi/_integrations.html index fa555c12e..d1a58e382 100644 --- a/multi/_integrations.html +++ b/multi/_integrations.html @@ -113,7 +113,7 @@ can see an example of how to set up such a custom AsyncRes //CUSTOMIZE HERE return factory; } -}

13.5.3 Traverson

If you’re using the Traverson library +}

13.5.3 Traverson

If you’re using the Traverson library it’s enough for you to inject a RestTemplate as a bean into your Traverson object. Since RestTemplate is already intercepted, you will get full support of tracing in your client. Below you can find a pseudo code of how to do that:

@Autowired RestTemplate restTemplate;
@@ -152,7 +152,7 @@ can see an example of how to set up such a custom Executor
 		executor.initialize();
 		return new LazyTraceExecutor(this.beanFactory, executor);
 	}
-}

13.8 Messaging

Spring Cloud Sleuth integrates with Spring Integration. It creates spans for publish and +}

13.8 Messaging

Spring Cloud Sleuth integrates with Spring Integration. It creates spans for publish and subscribe events. To disable Spring Integration instrumentation, set spring.sleuth.integration.enabled to false.

You can provide the spring.sleuth.integration.patterns pattern to explicitly provide the names of channels that you want to include for tracing. By default all channels are included.

[Important]Important

When using the Executor to build a Spring Integration IntegrationFlow remember to use the untraced version of the Executor. diff --git a/multi/_introduction.html b/multi/_introduction.html index db262d7a0..bd58cf6b4 100644 --- a/multi/_introduction.html +++ b/multi/_introduction.html @@ -1,6 +1,6 @@ - 1. Introduction

1. Introduction

Spring Cloud Sleuth implements a distributed tracing solution for Spring Cloud.

1.1 Terminology

Spring Cloud Sleuth borrows Dapper’s terminology.

Span: The basic unit of work. For example, sending an RPC is a new span, as is sending a response to an + 1. Introduction

1. Introduction

Spring Cloud Sleuth implements a distributed tracing solution for Spring Cloud.

1.1 Terminology

Spring Cloud Sleuth borrows Dapper’s terminology.

Span: The basic unit of work. For example, sending an RPC is a new span, as is sending a response to an RPC. Span’s are identified by a unique 64-bit ID for the span and another 64-bit ID for the trace the span is a part of. Spans also have other data, such as descriptions, timestamped events, key-value annotations (tags), the ID of the span that caused them, and process ID’s (normally IP address).

Spans are started and stopped, and they keep track of their timing information. Once you create a @@ -34,7 +34,7 @@ service2.log:2016-02-26 11:15:47.924 INFO [service2,2485ec27856c56f4,9aa10ee6fb service4.log:2016-02-26 11:15:48.134 INFO [service4,2485ec27856c56f4,1b1845262ffba49d,true] 68061 --- [nio-8084-exec-1] i.s.c.sleuth.docs.service4.Application : Hello from service4 service2.log:2016-02-26 11:15:48.156 INFO [service2,2485ec27856c56f4,9aa10ee6fbde75fa,true] 68059 --- [nio-8082-exec-1] i.s.c.sleuth.docs.service2.Application : Got response from service4 [Hello from service4] service1.log:2016-02-26 11:15:48.182 INFO [service1,2485ec27856c56f4,2485ec27856c56f4,true] 68058 --- [nio-8081-exec-1] i.s.c.sleuth.docs.service1.Application : Got response from service2 [Hello from service2, response from service3 [Hello from service3] and from service4 [Hello from service4]]

If you’re using a log aggregating tool like Kibana, -Splunk etc. you can order the events that took place. An example of +Splunk etc. you can order the events that took place. An example of Kibana would look like this:

Log correlation with Kibana

If you want to use Logstash here is the Grok pattern for Logstash:

filter {
        # pattern matching logback pattern
        grok {
diff --git a/multi/_metrics.html b/multi/_metrics.html
index 58125728b..df398e9dd 100644
--- a/multi/_metrics.html
+++ b/multi/_metrics.html
@@ -1,7 +1,7 @@
 
       
    12. Metrics

12. Metrics

Currently Spring Cloud Sleuth registers very simple metrics related to spans. -It’s using the Spring Boot’s metrics support +It’s using the Spring Boot’s metrics support to calculate the number of accepted and dropped spans. Each time a span gets sent to Zipkin the number of accepted spans will increase. If there’s an error then the number of dropped spans will get increased.

\ No newline at end of file diff --git a/multi/_running_examples.html b/multi/_running_examples.html index 10e0992e9..a7426d5b3 100644 --- a/multi/_running_examples.html +++ b/multi/_running_examples.html @@ -1,3 +1,3 @@ - 14. Running examples

14. Running examples

You can find the running examples deployed in the Pivotal Web Services. Check them out in the following links:

\ No newline at end of file + 14. Running examples

14. Running examples

You can find the running examples deployed in the Pivotal Web Services. Check them out in the following links:

\ No newline at end of file diff --git a/multi/_span_data_as_messages.html b/multi/_span_data_as_messages.html index 6dc020349..0fb2478c3 100644 --- a/multi/_span_data_as_messages.html +++ b/multi/_span_data_as_messages.html @@ -1,7 +1,7 @@ 11. Span Data as Messages

11. Span Data as Messages

You can accumulate and send span data over -Spring Cloud Stream by +Spring Cloud Stream by including the spring-cloud-sleuth-stream jar as a dependency, and adding a Channel Binder implementation (e.g. spring-cloud-starter-stream-rabbit for RabbitMQ or diff --git a/multi/multi__features.html b/multi/multi__features.html index 58c7029fa..7f93ddcbd 100644 --- a/multi/multi__features.html +++ b/multi/multi__features.html @@ -11,7 +11,7 @@ To that end, Sleuth:

  • Sleuth can propagate context (also known as baggage) between processes. Consequently, if you set a baggage element on a Span, it is sent downstream to other processes over either HTTP or messaging.
  • Provides a way to create or continue spans and add tags and logs through annotations.
  • If spring-cloud-sleuth-zipkin is on the classpath, the app generates and collects Zipkin-compatible traces. By default, it sends them over HTTP to a Zipkin server on localhost (port 9411). -You can configure the location of the service by setting spring.zipkin.baseUrl.

    • If you depend on spring-rabbit, your app sends traces to a RabbitMQ broker instead of HTTP.
    • If you depend on spring-kafka, and set spring.zipkin.sender.type: kafka, your app sends traces to a Kafka broker instead of HTTP.
[Caution]Caution

spring-cloud-sleuth-stream is deprecated and should no longer be used.

[Important]Important

If you use Zipkin, configure the probability of spans exported by setting spring.sleuth.sampler.probability +You can configure the location of the service by setting spring.zipkin.baseUrl.

  • If you depend on spring-rabbit, your app sends traces to a RabbitMQ broker instead of HTTP.
  • If you depend on spring-kafka, and set spring.zipkin.sender.type: kafka, your app sends traces to a Kafka broker instead of HTTP.
[Caution]Caution

spring-cloud-sleuth-stream is deprecated and should no longer be used.

[Important]Important

If you use Zipkin, configure the probability of spans exported by setting spring.sleuth.sampler.probability (default: 0.1, which is 10 percent). Otherwise, you might think that Sleuth is not working be cause it omits some spans.

[Note]Note

The SLF4J MDC is always set and logback users immediately see the trace and span IDs in logs per the example shown earlier. Other logging systems have to configure their own formatter to get the same result. @@ -80,7 +80,7 @@ The former is simpler to understand and test and does not tempt users with span void userCode() { span.annotate("tx.started"); ... -}

3.1.5 RPC tracing

[Tip]Tip

Check for instrumentation written here and Zipkin’s list before rolling your own RPC instrumentation.

RPC tracing is often done automatically by interceptors. Behind the scenes, they add tags and events that relate to their role in an RPC operation.

The following example shows how to add a client span:

@Autowired Tracing tracing;
+}

3.1.5 RPC tracing

[Tip]Tip

Check for instrumentation written here and Zipkin’s list before rolling your own RPC instrumentation.

RPC tracing is often done automatically by interceptors. Behind the scenes, they add tags and events that relate to their role in an RPC operation.

The following example shows how to add a client span:

@Autowired Tracing tracing;
 @Autowired Tracer tracer;
 
 // before you send a request, add metadata that describes the operation
diff --git a/multi/multi__integrations.html b/multi/multi__integrations.html
index 33fa48409..158415522 100644
--- a/multi/multi__integrations.html
+++ b/multi/multi__integrations.html
@@ -1,6 +1,6 @@
 
       
-   15. Integrations

15. Integrations

15.1 OpenTracing

Spring Cloud Sleuth is compatible with OpenTracing. + 15. Integrations

15. Integrations

15.1 OpenTracing

Spring Cloud Sleuth is compatible with OpenTracing. If you have OpenTracing on the classpath, we automatically register the OpenTracing Tracer bean. If you wish to disable this, set spring.sleuth.opentracing.enabled to false

15.2 Runnable and Callable

If you wrap your logic in Runnable or Callable, you can wrap those classes in their Sleuth representative, as shown in the following example for Runnable:

Runnable runnable = new Runnable() {
 	@Override
@@ -111,7 +111,7 @@ In the following snippet, you can see an example of how to set up such a custom
 	}
 
 }

15.6.3 WebClient

We inject a ExchangeFilterFunction implementation that creates a span and, through on-success and on-error callbacks, takes care of closing client-side spans.

To block this feature, set spring.sleuth.web.client.enabled to false.

[Important]Important

You have to register WebClient as a bean so that the tracing instrumentation gets applied. -If you create a WebClient instance with a new keyword, the instrumentation does NOT work.

15.6.4 Traverson

If you use the Traverson library, you can inject a RestTemplate as a bean into your Traverson object. +If you create a WebClient instance with a new keyword, the instrumentation does NOT work.

15.6.4 Traverson

If you use the Traverson library, you can inject a RestTemplate as a bean into your Traverson object. Since RestTemplate is already intercepted, you get full support for tracing in your client. The following pseudo code shows how to do that:

@Autowired RestTemplate restTemplate;
 
@@ -170,7 +170,7 @@ The following example shows how to set up such a custom Ex
 
 }
[Tip]Tip

To ensure that your configuration gets post processed, remember to add the @Role(BeanDefinition.ROLE_INFRASTRUCTURE) on your -@Configuration class

15.10 Messaging

Features from this section can be disabled by setting the spring.sleuth.messaging.enabled property with value equal to false.

15.10.1 Spring Integration and Spring Cloud Stream

Spring Cloud Sleuth integrates with Spring Integration. +@Configuration class

15.10 Messaging

Features from this section can be disabled by setting the spring.sleuth.messaging.enabled property with value equal to false.

15.10.1 Spring Integration and Spring Cloud Stream

Spring Cloud Sleuth integrates with Spring Integration. It creates spans for publish and subscribe events. To disable Spring Integration instrumentation, set spring.sleuth.integration.enabled to false.

You can provide the spring.sleuth.integration.patterns pattern to explicitly provide the names of channels that you want to include for tracing. By default, all channels but hystrixStreamOutput channel are included.

[Important]Important

When using the Executor to build a Spring Integration IntegrationFlow, you must use the untraced version of the Executor. diff --git a/multi/multi__introduction.html b/multi/multi__introduction.html index 004efac97..86b143d57 100644 --- a/multi/multi__introduction.html +++ b/multi/multi__introduction.html @@ -1,6 +1,6 @@ - 1. Introduction

1. Introduction

Spring Cloud Sleuth implements a distributed tracing solution for Spring Cloud.

1.1 Terminology

Spring Cloud Sleuth borrows Dapper’s terminology.

Span: The basic unit of work. For example, sending an RPC is a new span, as is sending a response to an RPC. + 1. Introduction

1. Introduction

Spring Cloud Sleuth implements a distributed tracing solution for Spring Cloud.

1.1 Terminology

Spring Cloud Sleuth borrows Dapper’s terminology.

Span: The basic unit of work. For example, sending an RPC is a new span, as is sending a response to an RPC. Spans are identified by a unique 64-bit ID for the span and another 64-bit ID for the trace the span is a part of. Spans also have other data, such as descriptions, timestamped events, key-value annotations (tags), the ID of the span that caused them, and process IDs (normally IP addresses).

Spans can be started and stopped, and they keep track of their timing information. Once you create a span, you must stop it at some point in the future.

[Tip]Tip

The initial span that starts a trace is called a root span. The value of the ID @@ -35,13 +35,13 @@ to service1 and three spans related to RPC calls.

If you click that trace, you see a similar picture, as follows:

Error Traces

If you then click on one of the spans, you see the following

Error Traces Info propagation

The span shows the reason for the error and the whole stack trace related to it.

1.2.3 Distributed Tracing with Brave

Starting with version 2.0.0, Spring Cloud Sleuth uses Brave as the tracing library. Consequently, Sleuth no longer takes care of storing the context but delegates that work to Brave.

Due to the fact that Sleuth had different naming and tagging conventions than Brave, we decided to follow Brave’s conventions from now on. -However, if you want to use the legacy Sleuth approaches, you can set the spring.sleuth.http.legacy.enabled property to true.

1.2.4 Live examples

Figure 1.1. Click the Pivotal Web Services icon to see it live!

Zipkin deployed on Pivotal Web Services

Click here to see it live!

The dependency graph in Zipkin should resemble the following image:

Dependencies

Figure 1.2. Click the Pivotal Web Services icon to see it live!

Zipkin deployed on Pivotal Web Services

Click here to see it live!

1.2.5 Log correlation

When using grep to read the logs of those four applications by scanning for a trace ID equal to (for example) 2485ec27856c56f4, you get output resembling the following:

service1.log:2016-02-26 11:15:47.561  INFO [service1,2485ec27856c56f4,2485ec27856c56f4,true] 68058 --- [nio-8081-exec-1] i.s.c.sleuth.docs.service1.Application   : Hello from service1. Calling service2
+However, if you want to use the legacy Sleuth approaches, you can set the spring.sleuth.http.legacy.enabled property to true.

1.2.4 Live examples

Figure 1.1. Click the Pivotal Web Services icon to see it live!

Zipkin deployed on Pivotal Web Services

Click here to see it live!

The dependency graph in Zipkin should resemble the following image:

Dependencies

Figure 1.2. Click the Pivotal Web Services icon to see it live!

Zipkin deployed on Pivotal Web Services

Click here to see it live!

1.2.5 Log correlation

When using grep to read the logs of those four applications by scanning for a trace ID equal to (for example) 2485ec27856c56f4, you get output resembling the following:

service1.log:2016-02-26 11:15:47.561  INFO [service1,2485ec27856c56f4,2485ec27856c56f4,true] 68058 --- [nio-8081-exec-1] i.s.c.sleuth.docs.service1.Application   : Hello from service1. Calling service2
 service2.log:2016-02-26 11:15:47.710  INFO [service2,2485ec27856c56f4,9aa10ee6fbde75fa,true] 68059 --- [nio-8082-exec-1] i.s.c.sleuth.docs.service2.Application   : Hello from service2. Calling service3 and then service4
 service3.log:2016-02-26 11:15:47.895  INFO [service3,2485ec27856c56f4,1210be13194bfe5,true] 68060 --- [nio-8083-exec-1] i.s.c.sleuth.docs.service3.Application   : Hello from service3
 service2.log:2016-02-26 11:15:47.924  INFO [service2,2485ec27856c56f4,9aa10ee6fbde75fa,true] 68059 --- [nio-8082-exec-1] i.s.c.sleuth.docs.service2.Application   : Got response from service3 [Hello from service3]
 service4.log:2016-02-26 11:15:48.134  INFO [service4,2485ec27856c56f4,1b1845262ffba49d,true] 68061 --- [nio-8084-exec-1] i.s.c.sleuth.docs.service4.Application   : Hello from service4
 service2.log:2016-02-26 11:15:48.156  INFO [service2,2485ec27856c56f4,9aa10ee6fbde75fa,true] 68059 --- [nio-8082-exec-1] i.s.c.sleuth.docs.service2.Application   : Got response from service4 [Hello from service4]
-service1.log:2016-02-26 11:15:48.182  INFO [service1,2485ec27856c56f4,2485ec27856c56f4,true] 68058 --- [nio-8081-exec-1] i.s.c.sleuth.docs.service1.Application   : Got response from service2 [Hello from service2, response from service3 [Hello from service3] and from service4 [Hello from service4]]

If you use a log aggregating tool (such as Kibana, Splunk, and others), you can order the events that took place. +service1.log:2016-02-26 11:15:48.182 INFO [service1,2485ec27856c56f4,2485ec27856c56f4,true] 68058 --- [nio-8081-exec-1] i.s.c.sleuth.docs.service1.Application : Got response from service2 [Hello from service2, response from service3 [Hello from service3] and from service4 [Hello from service4]]

If you use a log aggregating tool (such as Kibana, Splunk, and others), you can order the events that took place. An example from Kibana would resemble the following image:

Log correlation with Kibana

If you want to use Logstash, the following listing shows the Grok pattern for Logstash:

filter {
        # pattern matching logback pattern
        grok {
diff --git a/multi/multi__metrics.html b/multi/multi__metrics.html
index a3ae473fa..911b23b25 100644
--- a/multi/multi__metrics.html
+++ b/multi/multi__metrics.html
@@ -1,7 +1,7 @@
 
       
    12. Metrics

12. Metrics

Currently Spring Cloud Sleuth registers very simple metrics related to spans. -It’s using the Spring Boot’s metrics support +It’s using the Spring Boot’s metrics support to calculate the number of accepted and dropped spans. Each time a span gets sent to Zipkin the number of accepted spans will increase. If there’s an error then the number of dropped spans will get increased.

\ No newline at end of file diff --git a/multi/multi__running_examples.html b/multi/multi__running_examples.html index 44b1fe62f..07f9855d6 100644 --- a/multi/multi__running_examples.html +++ b/multi/multi__running_examples.html @@ -1,7 +1,7 @@ 16. Running examples

16. Running examples

You can see the running examples deployed in the Pivotal Web Services. -Check them out at the following links:

\ No newline at end of file diff --git a/multi/multi__span_data_as_messages.html b/multi/multi__span_data_as_messages.html index 0abcf862d..286e8c326 100644 --- a/multi/multi__span_data_as_messages.html +++ b/multi/multi__span_data_as_messages.html @@ -4,14 +4,14 @@ native support for message based span sending. Starting from Edgware Zipkin Stream server is deprecated and in Finchley it got removed.

You can accumulate and send span data over -Spring Cloud Stream by +Spring Cloud Stream by including the spring-cloud-sleuth-stream jar as a dependency, and adding a Channel Binder implementation (e.g. spring-cloud-starter-stream-rabbit for RabbitMQ or spring-cloud-starter-stream-kafka for Kafka). This will automatically turn your app into a producer of messages with payload type Spans. The channel name to which the spans will be sent -is called sleuth.

11.1 Zipkin Consumer

Please refer to the Dalston Documentaion +is called sleuth.

11.1 Zipkin Consumer

Please refer to the Dalston Documentaion on how to create a Stream Zipkin server. That approach has been deprecated in Edgware and removed in Finchley release.

11.2 Custom Consumer

A custom consumer can also easily be implemented using spring-cloud-sleuth-stream and binding to the SleuthSink. Example:

@EnableBinding(SleuthSink.class)
diff --git a/multi/multi__zipkin_stream_span_consumer.html b/multi/multi__zipkin_stream_span_consumer.html
index 6ed1bda61..ab37cf336 100644
--- a/multi/multi__zipkin_stream_span_consumer.html
+++ b/multi/multi__zipkin_stream_span_consumer.html
@@ -2,4 +2,4 @@
       
    14. Zipkin Stream Span Consumer

14. Zipkin Stream Span Consumer

[Important]Important

We recommend using Zipkin’s native support for message-based span sending. Starting from the Edgware release, the Zipkin Stream server is deprecated. -In the Finchley release, it got removed.

If for some reason you need to create the deprecated Stream Zipkin server, see the Dalston Documentation.

\ No newline at end of file +In the Finchley release, it got removed.

If for some reason you need to create the deprecated Stream Zipkin server, see the Dalston Documentation.

\ No newline at end of file diff --git a/single/spring-cloud-sleuth.html b/single/spring-cloud-sleuth.html index 5f69bec77..60d8cefb3 100644 --- a/single/spring-cloud-sleuth.html +++ b/single/spring-cloud-sleuth.html @@ -1,6 +1,6 @@ - Spring Cloud Sleuth

Spring Cloud Sleuth

Adrian Cole, Spencer Gibb, Marcin Grzejszczak, Dave Syer, Jay Bryant

Table of Contents

1. Introduction
1.1. Terminology
1.2. Purpose
1.2.1. Distributed Tracing with Zipkin
1.2.2. Visualizing errors
1.2.3. Distributed Tracing with Brave
1.2.4. Live examples
1.2.5. Log correlation
JSON Logback with Logstash
1.2.6. Propagating Span Context
Baggage versus Span Tags
1.3. Adding Sleuth to the Project
1.3.1. Only Sleuth (log correlation)
1.3.2. Sleuth with Zipkin via HTTP
1.3.3. Sleuth with Zipkin over RabbitMQ or Kafka
1.4. Overriding the auto-configuration of Zipkin
2. Additional Resources
3. Features
3.1. Introduction to Brave
3.1.1. Tracing
3.1.2. Local Tracing
3.1.3. Customizing Spans
3.1.4. Implicitly Looking up the Current Span
3.1.5. RPC tracing
One-Way tracing
4. Sampling
4.1. Declarative sampling
4.2. Custom sampling
4.3. Sampling in Spring Cloud Sleuth
5. Propagation
5.1. Propagating extra fields
5.1.1. Prefixed fields
5.1.2. Extracting a Propagated Context
5.1.3. Sharing span IDs between Client and Server
5.1.4. Implementing Propagation
6. Current Tracing Component
7. Current Span
7.1. Setting a span in scope manually
8. Instrumentation
9. Span lifecycle
9.1. Creating and finishing spans
9.2. Continuing Spans
9.3. Creating a Span with an explicit Parent
10. Naming spans
10.1. @SpanName Annotation
10.2. toString() method
11. Managing Spans with Annotations
11.1. Rationale
11.2. Creating New Spans
11.3. Continuing Spans
11.4. Advanced Tag Setting
11.4.1. Custom extractor
11.4.2. Resolving Expressions for a Value
11.4.3. Using the toString() method
12. Customizations
12.1. HTTP
12.2. TracingFilter
12.3. Custom service name
12.4. Customization of Reported Spans
12.5. Host Locator
13. Sending Spans to Zipkin
14. Zipkin Stream Span Consumer
15. Integrations
15.1. OpenTracing
15.2. Runnable and Callable
15.3. Hystrix
15.3.1. Custom Concurrency Strategy
15.3.2. Manual Command setting
15.4. RxJava
15.5. HTTP integration
15.5.1. HTTP Filter
15.5.2. HandlerInterceptor
15.5.3. Async Servlet support
15.5.4. WebFlux support
15.5.5. Dubbo RPC support
15.6. HTTP Client Integration
15.6.1. Synchronous Rest Template
15.6.2. Asynchronous Rest Template
Multiple Asynchronous Rest Templates
15.6.3. WebClient
15.6.4. Traverson
15.6.5. Apache HttpClientBuilder and HttpAsyncClientBuilder
15.6.6. Netty HttpClient
15.6.7. UserInfoRestTemplateCustomizer
15.7. Feign
15.8. gRPC
15.8.1. Variant 1
Dependencies
Server Instrumentation
Client Instrumentation
15.8.2. Variant 2
15.9. Asynchronous Communication
15.9.1. @Async Annotated methods
15.9.2. @Scheduled Annotated Methods
15.9.3. Executor, ExecutorService, and ScheduledExecutorService
Customization of Executors
15.10. Messaging
15.10.1. Spring Integration and Spring Cloud Stream
15.10.2. Spring RabbitMq
15.10.3. Spring Kafka
15.10.4. Spring JMS
15.11. Zuul
16. Running examples

2.1.2.BUILD-SNAPSHOT

1. Introduction

Spring Cloud Sleuth implements a distributed tracing solution for Spring Cloud.

1.1 Terminology

Spring Cloud Sleuth borrows Dapper’s terminology.

Span: The basic unit of work. For example, sending an RPC is a new span, as is sending a response to an RPC. + Spring Cloud Sleuth

Spring Cloud Sleuth

Adrian Cole, Spencer Gibb, Marcin Grzejszczak, Dave Syer, Jay Bryant

Table of Contents

1. Introduction
1.1. Terminology
1.2. Purpose
1.2.1. Distributed Tracing with Zipkin
1.2.2. Visualizing errors
1.2.3. Distributed Tracing with Brave
1.2.4. Live examples
1.2.5. Log correlation
JSON Logback with Logstash
1.2.6. Propagating Span Context
Baggage versus Span Tags
1.3. Adding Sleuth to the Project
1.3.1. Only Sleuth (log correlation)
1.3.2. Sleuth with Zipkin via HTTP
1.3.3. Sleuth with Zipkin over RabbitMQ or Kafka
1.4. Overriding the auto-configuration of Zipkin
2. Additional Resources
3. Features
3.1. Introduction to Brave
3.1.1. Tracing
3.1.2. Local Tracing
3.1.3. Customizing Spans
3.1.4. Implicitly Looking up the Current Span
3.1.5. RPC tracing
One-Way tracing
4. Sampling
4.1. Declarative sampling
4.2. Custom sampling
4.3. Sampling in Spring Cloud Sleuth
5. Propagation
5.1. Propagating extra fields
5.1.1. Prefixed fields
5.1.2. Extracting a Propagated Context
5.1.3. Sharing span IDs between Client and Server
5.1.4. Implementing Propagation
6. Current Tracing Component
7. Current Span
7.1. Setting a span in scope manually
8. Instrumentation
9. Span lifecycle
9.1. Creating and finishing spans
9.2. Continuing Spans
9.3. Creating a Span with an explicit Parent
10. Naming spans
10.1. @SpanName Annotation
10.2. toString() method
11. Managing Spans with Annotations
11.1. Rationale
11.2. Creating New Spans
11.3. Continuing Spans
11.4. Advanced Tag Setting
11.4.1. Custom extractor
11.4.2. Resolving Expressions for a Value
11.4.3. Using the toString() method
12. Customizations
12.1. HTTP
12.2. TracingFilter
12.3. Custom service name
12.4. Customization of Reported Spans
12.5. Host Locator
13. Sending Spans to Zipkin
14. Zipkin Stream Span Consumer
15. Integrations
15.1. OpenTracing
15.2. Runnable and Callable
15.3. Hystrix
15.3.1. Custom Concurrency Strategy
15.3.2. Manual Command setting
15.4. RxJava
15.5. HTTP integration
15.5.1. HTTP Filter
15.5.2. HandlerInterceptor
15.5.3. Async Servlet support
15.5.4. WebFlux support
15.5.5. Dubbo RPC support
15.6. HTTP Client Integration
15.6.1. Synchronous Rest Template
15.6.2. Asynchronous Rest Template
Multiple Asynchronous Rest Templates
15.6.3. WebClient
15.6.4. Traverson
15.6.5. Apache HttpClientBuilder and HttpAsyncClientBuilder
15.6.6. Netty HttpClient
15.6.7. UserInfoRestTemplateCustomizer
15.7. Feign
15.8. gRPC
15.8.1. Variant 1
Dependencies
Server Instrumentation
Client Instrumentation
15.8.2. Variant 2
15.9. Asynchronous Communication
15.9.1. @Async Annotated methods
15.9.2. @Scheduled Annotated Methods
15.9.3. Executor, ExecutorService, and ScheduledExecutorService
Customization of Executors
15.10. Messaging
15.10.1. Spring Integration and Spring Cloud Stream
15.10.2. Spring RabbitMq
15.10.3. Spring Kafka
15.10.4. Spring JMS
15.11. Zuul
16. Running examples

2.1.2.BUILD-SNAPSHOT

1. Introduction

Spring Cloud Sleuth implements a distributed tracing solution for Spring Cloud.

1.1 Terminology

Spring Cloud Sleuth borrows Dapper’s terminology.

Span: The basic unit of work. For example, sending an RPC is a new span, as is sending a response to an RPC. Spans are identified by a unique 64-bit ID for the span and another 64-bit ID for the trace the span is a part of. Spans also have other data, such as descriptions, timestamped events, key-value annotations (tags), the ID of the span that caused them, and process IDs (normally IP addresses).

Spans can be started and stopped, and they keep track of their timing information. Once you create a span, you must stop it at some point in the future.

[Tip]Tip

The initial span that starts a trace is called a root span. The value of the ID @@ -35,13 +35,13 @@ to service1 and three spans related to RPC calls.

If you click that trace, you see a similar picture, as follows:

Error Traces

If you then click on one of the spans, you see the following

Error Traces Info propagation

The span shows the reason for the error and the whole stack trace related to it.

1.2.3 Distributed Tracing with Brave

Starting with version 2.0.0, Spring Cloud Sleuth uses Brave as the tracing library. Consequently, Sleuth no longer takes care of storing the context but delegates that work to Brave.

Due to the fact that Sleuth had different naming and tagging conventions than Brave, we decided to follow Brave’s conventions from now on. -However, if you want to use the legacy Sleuth approaches, you can set the spring.sleuth.http.legacy.enabled property to true.

1.2.4 Live examples

Figure 1.1. Click the Pivotal Web Services icon to see it live!

Zipkin deployed on Pivotal Web Services

Click here to see it live!

The dependency graph in Zipkin should resemble the following image:

Dependencies

Figure 1.2. Click the Pivotal Web Services icon to see it live!

Zipkin deployed on Pivotal Web Services

Click here to see it live!

1.2.5 Log correlation

When using grep to read the logs of those four applications by scanning for a trace ID equal to (for example) 2485ec27856c56f4, you get output resembling the following:

service1.log:2016-02-26 11:15:47.561  INFO [service1,2485ec27856c56f4,2485ec27856c56f4,true] 68058 --- [nio-8081-exec-1] i.s.c.sleuth.docs.service1.Application   : Hello from service1. Calling service2
+However, if you want to use the legacy Sleuth approaches, you can set the spring.sleuth.http.legacy.enabled property to true.

1.2.4 Live examples

Figure 1.1. Click the Pivotal Web Services icon to see it live!

Zipkin deployed on Pivotal Web Services

Click here to see it live!

The dependency graph in Zipkin should resemble the following image:

Dependencies

Figure 1.2. Click the Pivotal Web Services icon to see it live!

Zipkin deployed on Pivotal Web Services

Click here to see it live!

1.2.5 Log correlation

When using grep to read the logs of those four applications by scanning for a trace ID equal to (for example) 2485ec27856c56f4, you get output resembling the following:

service1.log:2016-02-26 11:15:47.561  INFO [service1,2485ec27856c56f4,2485ec27856c56f4,true] 68058 --- [nio-8081-exec-1] i.s.c.sleuth.docs.service1.Application   : Hello from service1. Calling service2
 service2.log:2016-02-26 11:15:47.710  INFO [service2,2485ec27856c56f4,9aa10ee6fbde75fa,true] 68059 --- [nio-8082-exec-1] i.s.c.sleuth.docs.service2.Application   : Hello from service2. Calling service3 and then service4
 service3.log:2016-02-26 11:15:47.895  INFO [service3,2485ec27856c56f4,1210be13194bfe5,true] 68060 --- [nio-8083-exec-1] i.s.c.sleuth.docs.service3.Application   : Hello from service3
 service2.log:2016-02-26 11:15:47.924  INFO [service2,2485ec27856c56f4,9aa10ee6fbde75fa,true] 68059 --- [nio-8082-exec-1] i.s.c.sleuth.docs.service2.Application   : Got response from service3 [Hello from service3]
 service4.log:2016-02-26 11:15:48.134  INFO [service4,2485ec27856c56f4,1b1845262ffba49d,true] 68061 --- [nio-8084-exec-1] i.s.c.sleuth.docs.service4.Application   : Hello from service4
 service2.log:2016-02-26 11:15:48.156  INFO [service2,2485ec27856c56f4,9aa10ee6fbde75fa,true] 68059 --- [nio-8082-exec-1] i.s.c.sleuth.docs.service2.Application   : Got response from service4 [Hello from service4]
-service1.log:2016-02-26 11:15:48.182  INFO [service1,2485ec27856c56f4,2485ec27856c56f4,true] 68058 --- [nio-8081-exec-1] i.s.c.sleuth.docs.service1.Application   : Got response from service2 [Hello from service2, response from service3 [Hello from service3] and from service4 [Hello from service4]]

If you use a log aggregating tool (such as Kibana, Splunk, and others), you can order the events that took place. +service1.log:2016-02-26 11:15:48.182 INFO [service1,2485ec27856c56f4,2485ec27856c56f4,true] 68058 --- [nio-8081-exec-1] i.s.c.sleuth.docs.service1.Application : Got response from service2 [Hello from service2, response from service3 [Hello from service3] and from service4 [Hello from service4]]

If you use a log aggregating tool (such as Kibana, Splunk, and others), you can order the events that took place. An example from Kibana would resemble the following image:

Log correlation with Kibana

If you want to use Logstash, the following listing shows the Grok pattern for Logstash:

filter {
        # pattern matching logback pattern
        grok {
@@ -300,7 +300,7 @@ To that end, Sleuth:

  • Sleuth can propagate context (also known as baggage) between processes. Consequently, if you set a baggage element on a Span, it is sent downstream to other processes over either HTTP or messaging.
  • Provides a way to create or continue spans and add tags and logs through annotations.
  • If spring-cloud-sleuth-zipkin is on the classpath, the app generates and collects Zipkin-compatible traces. By default, it sends them over HTTP to a Zipkin server on localhost (port 9411). -You can configure the location of the service by setting spring.zipkin.baseUrl.

    • If you depend on spring-rabbit, your app sends traces to a RabbitMQ broker instead of HTTP.
    • If you depend on spring-kafka, and set spring.zipkin.sender.type: kafka, your app sends traces to a Kafka broker instead of HTTP.
[Caution]Caution

spring-cloud-sleuth-stream is deprecated and should no longer be used.

[Important]Important

If you use Zipkin, configure the probability of spans exported by setting spring.sleuth.sampler.probability +You can configure the location of the service by setting spring.zipkin.baseUrl.

  • If you depend on spring-rabbit, your app sends traces to a RabbitMQ broker instead of HTTP.
  • If you depend on spring-kafka, and set spring.zipkin.sender.type: kafka, your app sends traces to a Kafka broker instead of HTTP.
[Caution]Caution

spring-cloud-sleuth-stream is deprecated and should no longer be used.

[Important]Important

If you use Zipkin, configure the probability of spans exported by setting spring.sleuth.sampler.probability (default: 0.1, which is 10 percent). Otherwise, you might think that Sleuth is not working be cause it omits some spans.

[Note]Note

The SLF4J MDC is always set and logback users immediately see the trace and span IDs in logs per the example shown earlier. Other logging systems have to configure their own formatter to get the same result. @@ -369,7 +369,7 @@ The former is simpler to understand and test and does not tempt users with span void userCode() { span.annotate("tx.started"); ... -}

3.1.5 RPC tracing

[Tip]Tip

Check for instrumentation written here and Zipkin’s list before rolling your own RPC instrumentation.

RPC tracing is often done automatically by interceptors. Behind the scenes, they add tags and events that relate to their role in an RPC operation.

The following example shows how to add a client span:

@Autowired Tracing tracing;
+}

3.1.5 RPC tracing

[Tip]Tip

Check for instrumentation written here and Zipkin’s list before rolling your own RPC instrumentation.

RPC tracing is often done automatically by interceptors. Behind the scenes, they add tags and events that relate to their role in an RPC operation.

The following example shows how to add a client span:

@Autowired Tracing tracing;
 @Autowired Tracer tracer;
 
 // before you send a request, add metadata that describes the operation
@@ -834,7 +834,7 @@ object, you will have to create a bean of zipkin2.reporter
 		return myCustomSender(zipkin, restTemplate);
 	}

14. Zipkin Stream Span Consumer

[Important]Important

We recommend using Zipkin’s native support for message-based span sending. Starting from the Edgware release, the Zipkin Stream server is deprecated. -In the Finchley release, it got removed.

If for some reason you need to create the deprecated Stream Zipkin server, see the Dalston Documentation.

15. Integrations

15.1 OpenTracing

Spring Cloud Sleuth is compatible with OpenTracing. +In the Finchley release, it got removed.

If for some reason you need to create the deprecated Stream Zipkin server, see the Dalston Documentation.

15. Integrations

15.1 OpenTracing

Spring Cloud Sleuth is compatible with OpenTracing. If you have OpenTracing on the classpath, we automatically register the OpenTracing Tracer bean. If you wish to disable this, set spring.sleuth.opentracing.enabled to false

15.2 Runnable and Callable

If you wrap your logic in Runnable or Callable, you can wrap those classes in their Sleuth representative, as shown in the following example for Runnable:

Runnable runnable = new Runnable() {
 	@Override
@@ -945,7 +945,7 @@ In the following snippet, you can see an example of how to set up such a custom
 	}
 
 }

15.6.3 WebClient

We inject a ExchangeFilterFunction implementation that creates a span and, through on-success and on-error callbacks, takes care of closing client-side spans.

To block this feature, set spring.sleuth.web.client.enabled to false.

[Important]Important

You have to register WebClient as a bean so that the tracing instrumentation gets applied. -If you create a WebClient instance with a new keyword, the instrumentation does NOT work.

15.6.4 Traverson

If you use the Traverson library, you can inject a RestTemplate as a bean into your Traverson object. +If you create a WebClient instance with a new keyword, the instrumentation does NOT work.

15.6.4 Traverson

If you use the Traverson library, you can inject a RestTemplate as a bean into your Traverson object. Since RestTemplate is already intercepted, you get full support for tracing in your client. The following pseudo code shows how to do that:

@Autowired RestTemplate restTemplate;
 
@@ -1004,7 +1004,7 @@ The following example shows how to set up such a custom Ex
 
 }
[Tip]Tip

To ensure that your configuration gets post processed, remember to add the @Role(BeanDefinition.ROLE_INFRASTRUCTURE) on your -@Configuration class

15.10 Messaging

Features from this section can be disabled by setting the spring.sleuth.messaging.enabled property with value equal to false.

15.10.1 Spring Integration and Spring Cloud Stream

Spring Cloud Sleuth integrates with Spring Integration. +@Configuration class

15.10 Messaging

Features from this section can be disabled by setting the spring.sleuth.messaging.enabled property with value equal to false.

15.10.1 Spring Integration and Spring Cloud Stream

Spring Cloud Sleuth integrates with Spring Integration. It creates spans for publish and subscribe events. To disable Spring Integration instrumentation, set spring.sleuth.integration.enabled to false.

You can provide the spring.sleuth.integration.patterns pattern to explicitly provide the names of channels that you want to include for tracing. By default, all channels but hystrixStreamOutput channel are included.

[Important]Important

When using the Executor to build a Spring Integration IntegrationFlow, you must use the untraced version of the Executor. @@ -1015,7 +1015,7 @@ so that tracing headers get injected into the created Spring Kafka’s Producer and Consumer.

To block this feature, set spring.sleuth.messaging.kafka.enabled to false.

15.10.4 Spring JMS

We instrument the JmsTemplate so that tracing headers get injected into the message. We also support @JmsListener annotated methods on the consumer side.

To block this feature, set spring.sleuth.messaging.jms.enabled to false.

[Important]Important

We don’t support baggage propagation for JMS

15.11 Zuul

We instrument the Zuul Ribbon integration by enriching the Ribbon requests with tracing information. To disable Zuul support, set the spring.sleuth.zuul.enabled property to false.

16. Running examples

You can see the running examples deployed in the Pivotal Web Services. -Check them out at the following links:

\ No newline at end of file diff --git a/spring-cloud-sleuth.html b/spring-cloud-sleuth.html index 40913c2d9..bc6d40e8e 100644 --- a/spring-cloud-sleuth.html +++ b/spring-cloud-sleuth.html @@ -34,7 +34,7 @@ color: #ffffff; } - +