You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2019/09/01 01:47:43 UTC
[skywalking] branch master updated: docs: Improve envoy metrics
sending setup documentation (#3389)
This is an automated email from the ASF dual-hosted git repository.
wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking.git
The following commit(s) were added to refs/heads/master by this push:
new 53a1ae8 docs: Improve envoy metrics sending setup documentation (#3389)
53a1ae8 is described below
commit 53a1ae8e826e1471a6a942a7dbe3a3583db21709
Author: Dhi Aurrahman <di...@tetrate.io>
AuthorDate: Sun Sep 1 08:47:38 2019 +0700
docs: Improve envoy metrics sending setup documentation (#3389)
* Add envoy metrics sending example
Signed-off-by: Dhi Aurrahman <di...@tetrate.io>
* Newline
Signed-off-by: Dhi Aurrahman <di...@tetrate.io>
* Fix
Signed-off-by: Dhi Aurrahman <di...@tetrate.io>
* Tear down note
Signed-off-by: Dhi Aurrahman <di...@tetrate.io>
* Typo
Signed-off-by: Dhi Aurrahman <di...@tetrate.io>
---
docs/en/setup/envoy/config.yaml | 20 +++++++-
docs/en/setup/envoy/examples/metrics/Makefile | 23 +++++++++
docs/en/setup/envoy/examples/metrics/README.md | 56 ++++++++++++++++++++++
.../envoy/examples/metrics/docker-compose.yaml | 34 +++++++++++++
.../{config.yaml => examples/metrics/envoy.yaml} | 23 +++++++--
docs/en/setup/envoy/examples/metrics/log4j2.xml | 38 +++++++++++++++
6 files changed, 190 insertions(+), 4 deletions(-)
diff --git a/docs/en/setup/envoy/config.yaml b/docs/en/setup/envoy/config.yaml
index f99a91d..3a00c2e 100644
--- a/docs/en/setup/envoy/config.yaml
+++ b/docs/en/setup/envoy/config.yaml
@@ -1,3 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
admin:
access_log_path: /tmp/admin_access.log
address:
@@ -5,6 +21,7 @@ admin:
protocol: TCP
address: 127.0.0.1
port_value: 9901
+
stats_sinks:
- name: envoy.metrics_service
config:
@@ -66,7 +83,8 @@ static_resources:
address:
socket_address:
address: skywalking
- port_value: 9001
+ # This is the port where SkyWalking serving the Envoy Metrics Service gRPC stream.
+ port_value: 11800
- name: service_google
connect_timeout: 5s
diff --git a/docs/en/setup/envoy/examples/metrics/Makefile b/docs/en/setup/envoy/examples/metrics/Makefile
new file mode 100644
index 0000000..da68d63
--- /dev/null
+++ b/docs/en/setup/envoy/examples/metrics/Makefile
@@ -0,0 +1,23 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+up:
+ docker-compose up -d
+
+down:
+ docker-compose down
+
+.PHONY: up down
diff --git a/docs/en/setup/envoy/examples/metrics/README.md b/docs/en/setup/envoy/examples/metrics/README.md
new file mode 100644
index 0000000..0f24657
--- /dev/null
+++ b/docs/en/setup/envoy/examples/metrics/README.md
@@ -0,0 +1,56 @@
+# Sending Envoy Metrics to SkyWalking OAP Server Example
+
+This is an example of sending [Envoy Stats](https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/observability/statistics#arch-overview-statistics) to SkyWalking OAP server
+through [Metric Service](https://www.envoyproxy.io/docs/envoy/latest/api-v2/config/metrics/v2/metrics_service.proto).
+
+## Running the example
+
+The example requires `docker` and `docker-compose` to be installed in your local. It fetches images from Docker Hub.
+
+Note that in ths setup, we override the [`log4j2.xml`](log4j2.xml) config to set the `org.apache.skywalking.oap.server.receiver.envoy` logger level to `DEBUG`. This enables us to see the messages sent by Envoy to SkyWalking OAP server.
+
+```
+$ make up
+$ docker-compose logs -f skywalking
+$ # Please wait for a moment until SkyWalking is ready and Envoy starts sending the stats. You will see similar messages like the following:
+skywalking_1 | 2019-08-31 23:57:40,672 - org.apache.skywalking.oap.server.receiver.envoy.MetricServiceGRPCHandler -26870 [grpc-default-executor-0] DEBUG [] - Received msg identifier {
+skywalking_1 | node {
+skywalking_1 | id: "ingress"
+skywalking_1 | cluster: "envoy-proxy"
+skywalking_1 | metadata {
+skywalking_1 | fields {
+skywalking_1 | key: "skywalking"
+skywalking_1 | value {
+skywalking_1 | string_value: "iscool"
+skywalking_1 | }
+skywalking_1 | }
+skywalking_1 | fields {
+skywalking_1 | key: "envoy"
+skywalking_1 | value {
+skywalking_1 | string_value: "isawesome"
+skywalking_1 | }
+skywalking_1 | }
+skywalking_1 | }
+skywalking_1 | locality {
+skywalking_1 | region: "ap-southeast-1"
+skywalking_1 | zone: "zone1"
+skywalking_1 | sub_zone: "subzone1"
+skywalking_1 | }
+skywalking_1 | build_version: "e349fb6139e4b7a59a9a359be0ea45dd61e589c5/1.11.1/Clean/RELEASE/BoringSSL"
+skywalking_1 | }
+skywalking_1 | }
+skywalking_1 | envoy_metrics {
+skywalking_1 | name: "cluster.service_skywalking.update_success"
+skywalking_1 | type: COUNTER
+skywalking_1 | metric {
+skywalking_1 | counter {
+skywalking_1 | value: 2.0
+skywalking_1 | }
+skywalking_1 | timestamp_ms: 1567295859556
+skywalking_1 | }
+skywalking_1 | }
+...
+
+$ # To tear down:
+$ make down
+```
diff --git a/docs/en/setup/envoy/examples/metrics/docker-compose.yaml b/docs/en/setup/envoy/examples/metrics/docker-compose.yaml
new file mode 100644
index 0000000..2250d52
--- /dev/null
+++ b/docs/en/setup/envoy/examples/metrics/docker-compose.yaml
@@ -0,0 +1,34 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+version: "3"
+services:
+ envoy:
+ image: envoyproxy/envoy-alpine:latest
+ command: /usr/local/bin/envoy -c /etc/envoy.yaml --service-cluster envoy-proxy
+ ports:
+ - 10000:10000
+ depends_on:
+ - skywalking
+ volumes:
+ - ./envoy.yaml:/etc/envoy.yaml
+
+ skywalking:
+ image: apache/skywalking-oap-server:latest
+ volumes:
+ - ./log4j2.xml:/skywalking/config/log4j2.xml
+ expose:
+ - "11800"
diff --git a/docs/en/setup/envoy/config.yaml b/docs/en/setup/envoy/examples/metrics/envoy.yaml
similarity index 73%
copy from docs/en/setup/envoy/config.yaml
copy to docs/en/setup/envoy/examples/metrics/envoy.yaml
index f99a91d..af688f8 100644
--- a/docs/en/setup/envoy/config.yaml
+++ b/docs/en/setup/envoy/examples/metrics/envoy.yaml
@@ -1,3 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
admin:
access_log_path: /tmp/admin_access.log
address:
@@ -5,6 +21,7 @@ admin:
protocol: TCP
address: 127.0.0.1
port_value: 9901
+
stats_sinks:
- name: envoy.metrics_service
config:
@@ -53,7 +70,7 @@ static_resources:
clusters:
- name: service_skywalking
connect_timeout: 5s
- type: LOGICAL_DNS
+ type: STRICT_DNS
http2_protocol_options: {}
# Comment out the following line to test on v6 networks
dns_lookup_family: V4_ONLY
@@ -66,11 +83,11 @@ static_resources:
address:
socket_address:
address: skywalking
- port_value: 9001
+ port_value: 11800
- name: service_google
connect_timeout: 5s
- type: LOGICAL_DNS
+ type: STRICT_DNS
# Comment out the following line to test on v6 networks
dns_lookup_family: V4_ONLY
lb_policy: ROUND_ROBIN
diff --git a/docs/en/setup/envoy/examples/metrics/log4j2.xml b/docs/en/setup/envoy/examples/metrics/log4j2.xml
new file mode 100644
index 0000000..6c3774e
--- /dev/null
+++ b/docs/en/setup/envoy/examples/metrics/log4j2.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one or more
+ ~ contributor license agreements. See the NOTICE file distributed with
+ ~ this work for additional information regarding copyright ownership.
+ ~ The ASF licenses this file to You under the Apache License, Version 2.0
+ ~ (the "License"); you may not use this file except in compliance with
+ ~ the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ ~
+ -->
+
+<Configuration status="INFO">
+ <Appenders>
+ <Console name="Console" target="SYSTEM_OUT">
+ <PatternLayout charset="UTF-8" pattern="%d - %c -%-4r [%t] %-5p %x - %m%n"/>
+ </Console>
+ </Appenders>
+ <Loggers>
+ <logger name="org.eclipse.jetty" level="INFO"/>
+ <logger name="org.apache.zookeeper" level="INFO"/>
+ <logger name="org.elasticsearch.common.network.IfConfig" level="INFO"/>
+ <logger name="io.grpc.netty" level="INFO"/>
+ <logger name="org.apache.skywalking.oap.server.receiver.istio.telemetry" level="DEBUG"/>
+ <!-- We make envoy metrics receiver to log at DEBUG level -->
+ <logger name="org.apache.skywalking.oap.server.receiver.envoy" level="DEBUG"/>
+ <Root level="INFO">
+ <AppenderRef ref="Console"/>
+ </Root>
+ </Loggers>
+</Configuration>