-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tracer: Add SkyWalking tracer #13060
Changes from 67 commits
74e0892
f384820
b8ce5a3
f95f9dd
f44d946
bf033d8
348387e
d689a88
3dcb800
5583faf
bd16737
44a954f
6bef0f4
7c05904
7c80783
e57eca8
86da0e7
a88e92d
7b1cee9
0156a82
0a8d5e7
40150ee
8a15758
1ae2902
fe02559
c7c148e
a8ca0fc
4184636
647679e
e10a47b
c914203
75f5ed7
0952632
b518d3e
73a7f2d
3373ab8
c58cf8f
f76ea47
33d9e61
46a82ab
c63db99
57348a3
1adcbb2
9804a03
73cd767
b622945
641d546
ada59bc
0a659b3
c3fa2d9
c705f4e
69d7dd1
998c8a1
fbc6b93
056c459
82ef1fe
f80844a
7488a66
e4a815a
d9a1278
c3b30c8
b2e8661
753f79f
32ba207
749f69a
ec03cb7
8fa92a2
fdc58a0
b93d3ff
675f634
f95b77d
6aab97c
fe43441
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
syntax = "proto3"; | ||
|
||
package envoy.config.trace.v3; | ||
|
||
import "envoy/config/core/v3/grpc_service.proto"; | ||
|
||
import "google/protobuf/wrappers.proto"; | ||
|
||
import "udpa/annotations/migrate.proto"; | ||
import "udpa/annotations/sensitive.proto"; | ||
import "udpa/annotations/status.proto"; | ||
import "udpa/annotations/versioning.proto"; | ||
import "validate/validate.proto"; | ||
|
||
option java_package = "io.envoyproxy.envoy.config.trace.v3"; | ||
option java_outer_classname = "SkywalkingProto"; | ||
option java_multiple_files = true; | ||
option (udpa.annotations.file_migrate).move_to_package = | ||
"envoy.extensions.tracers.skywalking.v4alpha"; | ||
option (udpa.annotations.file_status).package_version_status = ACTIVE; | ||
|
||
// [#protodoc-title: SkyWalking tracer] | ||
|
||
// Configuration for the SkyWalking tracer. Please note that if SkyWalking tracer is used as the | ||
// provider of http tracer, then | ||
// :ref:`start_child_span <envoy_v3_api_field_extensions.filters.http.router.v3.Router.start_child_span>` | ||
// in the router must be set to true to get the correct topology and tracing data. Moreover, SkyWalking | ||
// Tracer does not support SkyWalking extension header (``sw8-x``) temporarily. | ||
// [#extension: envoy.tracers.skywalking] | ||
message SkyWalkingConfig { | ||
// SkyWalking collector service. | ||
core.v3.GrpcService grpc_service = 1 [(validate.rules).message = {required: true}]; | ||
|
||
ClientConfig client_config = 2; | ||
} | ||
|
||
// Client config for SkyWalking tracer. | ||
message ClientConfig { | ||
// Service name for SkyWalking tracer. If this field is empty, then local service cluster name | ||
// that configured by :ref:`Bootstrap node <envoy_v3_api_field_config.bootstrap.v3.Bootstrap.node>` | ||
// message's :ref:`cluster <envoy_v3_api_field_config.core.v3.Node.cluster>` field or command line | ||
// option :option:`--service-cluster` will be used. If both this field and local service cluster | ||
// name are empty, ``EnvoyProxy`` is used as the service name by default. | ||
string service_name = 1; | ||
|
||
// Service instance name for SkyWalking tracer. If this field is empty, then local service node | ||
// that configured by :ref:`Bootstrap node <envoy_v3_api_field_config.bootstrap.v3.Bootstrap.node>` | ||
// message's :ref:`id <envoy_v3_api_field_config.core.v3.Node.id>` field or command line option | ||
// :option:`--service-node` will be used. If both this field and local service node are empty, | ||
// ``EnvoyProxy`` is used as the instance name by default. | ||
string instance_name = 2; | ||
|
||
// Authentication token config for SkyWalking. SkyWalking can use token authentication to secure | ||
// that monitoring application data can be trusted. In current version, Token is considered as a | ||
// simple string. | ||
// [#comment:TODO(wbpcode): Get backend token through the SDS API.] | ||
oneof backend_token_specifier { | ||
// Inline authentication token string. | ||
string backend_token = 3 [(udpa.annotations.sensitive) = true]; | ||
} | ||
|
||
// Envoy caches the segment in memory when the SkyWalking backend service is temporarily unavailable. | ||
// This field specifies the maximum number of segments that can be cached. If not specified, the | ||
// default is 1024. | ||
google.protobuf.UInt32Value max_cache_size = 4; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,3 +29,4 @@ features. The following sandboxes are available: | |
redis | ||
wasm-cc | ||
zipkin_tracing | ||
skywalking_tracing |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
.. _install_sandboxes_skywalking_tracing: | ||
|
||
SkyWalking Tracing | ||
================== | ||
|
||
The SkyWalking tracing sandbox demonstrates Envoy's :ref:`request tracing <arch_overview_tracing>` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @phlax for sandbox review. |
||
capabilities using `SkyWalking <http://skywalking.apache.org>`_ as the tracing provider. This sandbox | ||
is very similar to the Zipkin sandbox. All containers will be deployed inside a virtual network | ||
called ``envoymesh``. | ||
|
||
All incoming requests are routed via the front Envoy, which is acting as a reverse proxy | ||
sitting on the edge of the ``envoymesh`` network. Port ``8000`` is exposed | ||
by docker compose (see :repo:`/examples/skywalking-tracing/docker-compose.yaml`). Notice that | ||
all Envoys are configured to collect request traces (e.g., http_connection_manager/config/tracing setup in | ||
:repo:`/examples/skywalking-tracing/front-envoy-skywalking.yaml`) and setup to propagate the spans generated | ||
by the SkyWalking tracer to a SkyWalking cluster (trace driver setup | ||
in :repo:`/examples/skywalking-tracing/front-envoy-skywalking.yaml`). | ||
|
||
When service1 accepts the request forwarded from front envoy, it will make an API call to service2 before | ||
returning a response. | ||
|
||
.. include:: _include/docker-env-setup.rst | ||
|
||
Step 3: Build the sandbox | ||
************************* | ||
|
||
To build this sandbox example, and start the example apps run the following commands: | ||
|
||
.. code-block:: console | ||
|
||
$ pwd | ||
envoy/examples/skywalking-tracing | ||
$ docker-compose pull | ||
$ docker-compose up --build -d | ||
$ docker-compose ps | ||
|
||
Name Command State Ports | ||
-------------------------------------------------------------------------------------------------------------------------------------------------- | ||
skywalking-tracing_elasticsearch_1 /tini -- /usr/local/bin/do ... Up (healthy) 0.0.0.0:9200->9200/tcp, 9300/tcp | ||
skywalking-tracing_front-envoy_1 /docker-entrypoint.sh /bin ... Up 10000/tcp, 0.0.0.0:8000->8000/tcp, 0.0.0.0:8001->8001/tcp | ||
skywalking-tracing_service1_1 /bin/sh /usr/local/bin/sta ... Up 10000/tcp | ||
skywalking-tracing_service2_1 /bin/sh /usr/local/bin/sta ... Up 10000/tcp | ||
skywalking-tracing_skywalking-oap_1 bash docker-entrypoint.sh Up (healthy) 0.0.0.0:11800->11800/tcp, 1234/tcp, 0.0.0.0:12800->12800/tcp | ||
skywalking-tracing_skywalking-ui_1 bash docker-entrypoint.sh Up 0.0.0.0:8080->8080/tcp | ||
|
||
Step 4: Generate some load | ||
************************** | ||
|
||
You can now send a request to service1 via the front-envoy as follows: | ||
|
||
.. code-block:: console | ||
|
||
$ curl -v localhost:8000/trace/1 | ||
* Trying ::1... | ||
* TCP_NODELAY set | ||
* Connected to localhost (::1) port 8000 (#0) | ||
> GET /trace/1 HTTP/1.1 | ||
> Host: localhost:8000 | ||
> User-Agent: curl/7.58.0 | ||
> Accept: */* | ||
> | ||
< HTTP/1.1 200 OK | ||
< content-type: text/html; charset=utf-8 | ||
< content-length: 89 | ||
< server: envoy | ||
< date: Sat, 10 Oct 2020 01:56:08 GMT | ||
< x-envoy-upstream-service-time: 27 | ||
< | ||
Hello from behind Envoy (service 1)! hostname: 1a2ba43d6d84 resolvedhostname: 172.19.0.6 | ||
* Connection #0 to host localhost left intact | ||
|
||
You can get SkyWalking stats of front-envoy after some requests as follows: | ||
|
||
.. code-block:: console | ||
|
||
$ curl -s localhost:8001/stats | grep tracing.skywalking | ||
tracing.skywalking.cache_flushed: 0 | ||
tracing.skywalking.segments_dropped: 0 | ||
tracing.skywalking.segments_flushed: 0 | ||
tracing.skywalking.segments_sent: 13 | ||
|
||
Step 5: View the traces in SkyWalking UI | ||
**************************************** | ||
|
||
Point your browser to http://localhost:8080 . You should see the SkyWalking dashboard. | ||
wbpcode marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Set the service to "front-envoy" and set the start time to a few minutes before | ||
the start of the test (step 2) and hit enter. You should see traces from the front-proxy. | ||
Click on a trace to explore the path taken by the request from front-proxy to service1 | ||
to service2, as well as the latency incurred at each hop. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM envoyproxy/envoy-dev:latest | ||
|
||
RUN apt-get update && apt-get -q install -y \ | ||
curl | ||
COPY ./front-envoy-skywalking.yaml /etc/front-envoy.yaml | ||
RUN chmod go+r /etc/front-envoy.yaml | ||
CMD /usr/local/bin/envoy -c /etc/front-envoy.yaml --service-cluster front-proxy |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
To learn about this sandbox and for instructions on how to run it please head over | ||
to the [envoy docs](https://www.envoyproxy.io/docs/envoy/latest/start/sandboxes/skywalking_tracing) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
8.2.0 is out at https://github.com/apache/skywalking-data-collect-protocol/releases/tag/v8.2.0. Do you want to bump here or do as a follow up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
8.1.0 and 8.2.0 are the same for the tracing format of the language agent. I think it is fine.
SkyWalking wouldn't break the tracing format for a long time to keep all language agents compatible and LTS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is an envoy project requirement, @wbpcode the 8.1.0->8.2.0 should not break anything you wrote :)