Add the metrics analysis in Satellite MetricsService. (#8312)

This commit is contained in:
mrproliu 2021-12-18 20:03:18 +08:00 committed by GitHub
parent 1b85b96570
commit 28844632ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 146 additions and 254 deletions

View File

@ -16,6 +16,7 @@ Release Notes.
* Fix potential NPE in OAL string match and a bug when right-hand-side variable includes double quotes.
* Bump up Armeria version to fix CVE.
* Polish ETCD cluster config environment variables.
* Add the analysis of metrics in Satellite MetricsService.
#### UI

View File

@ -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.
expSuffix: tag({tags -> tags.service = 'satellite::' + tags.service}).instance(['service'], ['instance'])
metricPrefix: satellite
metricsRules:
- name: instance_receive_event_count
exp: sw_stl_gatherer_receive_count.sum(["pipe", "status", "service", "instance"]).increase("PT1M")
- name: instance_fetch_event_count
exp: sw_stl_gatherer_fetch_count.sum(["pipe", "status", "service", "instance"]).increase("PT1M")
- name: instance_queue_input_count
exp: sw_stl_queue_output_count.sum(["pipe", "status", "service", "instance"]).increase("PT1M")
- name: instance_send_event_count
exp: sw_stl_sender_output_count.sum(["pipe", "status", "service", "instance"]).increase("PT1M")
- name: instance_queue_total_capacity
exp: sw_stl_pipeline_queue_total_capacity.sum(["pipeline", "service", "instance"])
- name: instance_queue_used_count
exp: sw_stl_pipeline_queue_partition_size.sum(["pipeline", "service", "instance"])
- name: instance_server_cpu_utilization
exp: sw_stl_grpc_server_cpu_gauge
- name: instance_grpc_connect_count
exp: sw_stl_grpc_server_connection_count

View File

@ -24,6 +24,7 @@ telemetry:
cluster: cluster1
service: service1
instance: instance1
export_type: none
sharing:
common_config:

View File

@ -21,4 +21,4 @@ FROM alpine:3.10
COPY --from=base /skywalking-satellite /sw-satellite
COPY --from=base /skywalking/configs /skywalking/
ENTRYPOINT ["/sw-satellite", "start", "--config", "/skywalking/configs/satellite_config.yaml"]
ENTRYPOINT ["/sw-satellite", "start", "--config", "/skywalking/satellite_config.yaml"]

View File

@ -67,8 +67,7 @@ services:
SATELLITE_GRPC_CLIENT: oap:11800
SATELLITE_LOGPIPE_SENDER_MIN_FLUSH_EVENTS: 1
SW_AGENT_SATELLITE_COMMIT: ${SW_AGENT_SATELLITE_COMMIT}
volumes:
- ./satellite_config.yaml:/skywalking/configs/satellite_config.yaml
SATELLITE_GRPC_ACCEPT_LIMIT_CPU_UTILIZATION: 100
networks:
- e2e
healthcheck:

View File

@ -76,7 +76,7 @@ verify:
expected: expected/trace-info-detail.yml
# native meter: instance meter
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name meter_jvm_classes_loaded --instance-name=provider1 --service-name=e2e-service-provider |yq e 'to_entries' -
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name meter_jvm_memory_used --instance-name=provider1 --service-name=e2e-service-provider |yq e 'to_entries' -
expected: expected/metrics-has-value.yml
# native event: event list

View File

@ -1,249 +0,0 @@
#
# 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.
#
# The logger configuration.
logger:
# The log format pattern configuration.
log_pattern: ${SATELLITE_LOGGER_LOG_PATTERN:%time [%level][%field] - %msg}
# The time format pattern configuration.
time_pattern: ${SATELLITE_LOGGER_TIME_PATTERN:2006-01-02 15:04:05.000}
# The lowest level of printing allowed.
level: ${SATELLITE_LOGGER_LEVEL:info}
# The Satellite self telemetry configuration.
telemetry:
# The space concept for the deployment, such as the namespace concept in the Kubernetes.
cluster: ${SATELLITE_TELEMETRY_CLUSTER:satellite-cluster}
# The group concept for the deployment, such as the service resource concept in the Kubernetes.
service: ${SATELLITE_TELEMETRY_SERVICE:satellite-service}
# The minimum running unit, such as the pod concept in the Kubernetes.
instance: ${SATELLITE_TELEMETRY_SERVICE:satellite-instance}
# The sharing plugins referenced by the specific plugins in the different pipes.
sharing:
clients:
- plugin_name: "grpc-client"
# The gRPC server address (default localhost:11800).
server_addr: ${SATELLITE_GRPC_CLIENT:127.0.0.1:11800}
# The TLS switch
enable_TLS: ${SATELLITE_GRPC_ENABLE_TLS:false}
# The file path of client.pem. The config only works when opening the TLS switch.
client_pem_path: ${SATELLITE_GRPC_CLIENT_PEM_PATH:"client.pem"}
# The file path of client.key. The config only works when opening the TLS switch.
client_key_path: ${SATELLITE_GRPC_CLIENT_KEY_PATH:"client.key"}
# InsecureSkipVerify controls whether a client verifies the server's certificate chain and host name.
insecure_skip_verify: ${SATELLITE_GRPC_INSECURE_SKIP_VERIFY:false}
# The file path oca.pem. The config only works when opening the TLS switch.
ca_pem_path: ${SATELLITE_grpc_CA_PEM_PATH:"ca.pem"}
# How frequently to check the connection(second)
check_period: ${SATELLITE_GRPC_CHECK_PERIOD:5}
# The auth value when send request
authentication: ${SATELLITE_GRPC_AUTHENTICATION:""}
servers:
- plugin_name: "grpc-server"
# The address of grpc server.
address: ${SATELLITE_GRPC_ADDRESS:":11800"}
# The TLS cert file path.
tls_cert_file: ${SATELLITE_GRPC_TLS_KEY_FILE:""}
# The TLS key file path.
tls_key_file: ${SATELLITE_GRPC_TLS_KEY_FILE:""}
- plugin_name: "prometheus-server"
# The prometheus server address.
address: ${SATELLITE_PROMETHEUS_ADDRESS:":1234"}
# The prometheus server metrics endpoint.
endpoint: ${SATELLITE_PROMETHEUS_ENDPOINT:"/metrics"}
# The working pipe configurations.
pipes:
- common_config:
pipe_name: logpipe
gatherer:
server_name: "grpc-server"
receiver:
plugin_name: "grpc-nativelog-receiver"
queue:
plugin_name: "memory-queue"
# The maximum buffer event size.
event_buffer_size: ${SATELLITE_QUEUE_EVENT_BUFFER_SIZE:5000}
processor:
filters:
sender:
fallbacker:
plugin_name: none-fallbacker
# The time interval between two flush operations. And the time unit is millisecond.
flush_time: ${SATELLITE_LOGPIPE_SENDER_FLUSH_TIME:1000}
# The maximum buffer elements.
max_buffer_size: ${SATELLITE_LOGPIPE_SENDER_MAX_BUFFER_SIZE:200}
# The minimum flush elements.
min_flush_events: ${SATELLITE_LOGPIPE_SENDER_MIN_FLUSH_EVENTS:100}
client_name: grpc-client
forwarders:
- plugin_name: nativelog-grpc-forwarder
- common_config:
pipe_name: managementpipe
gatherer:
server_name: "grpc-server"
receiver:
plugin_name: "grpc-nativemanagement-receiver"
queue:
plugin_name: "memory-queue"
# The maximum buffer event size.
event_buffer_size: ${SATELLITE_QUEUE_EVENT_BUFFER_SIZE:5000}
processor:
filters:
sender:
fallbacker:
plugin_name: none-fallbacker
# The time interval between two flush operations. And the time unit is millisecond.
flush_time: ${SATELLITE_LOGMANAGEMENT_SENDER_FLUSH_TIME:1000}
# The maximum buffer elements.
max_buffer_size: ${SATELLITE_LOGMANAGEMENT_SENDER_MAX_BUFFER_SIZE:20}
# The minimum flush elements.
min_flush_events: ${SATELLITE_LOGMANAGEMENT_SENDER_MIN_FLUSH_EVENTS:1}
client_name: grpc-client
forwarders:
- plugin_name: nativemanagement-grpc-forwarder
- common_config:
pipe_name: tracingpipe
gatherer:
server_name: "grpc-server"
receiver:
plugin_name: "grpc-nativetracing-receiver"
queue:
plugin_name: "memory-queue"
# The maximum buffer event size.
event_buffer_size: ${SATELLITE_QUEUE_EVENT_BUFFER_SIZE:5000}
processor:
filters:
sender:
fallbacker:
plugin_name: none-fallbacker
# The time interval between two flush operations. And the time unit is millisecond.
flush_time: ${SATELLITE_TRACINGPIPE_SENDER_FLUSH_TIME:1000}
# The maximum buffer elements.
max_buffer_size: ${SATELLITE_TRACINGPIPE_SENDER_MAX_BUFFER_SIZE:200}
# The minimum flush elements.
min_flush_events: ${SATELLITE_TRACINGPIPE_SENDER_MIN_FLUSH_EVENTS:1}
client_name: grpc-client
forwarders:
- plugin_name: nativetracing-grpc-forwarder
- common_config:
pipe_name: profilepipe
gatherer:
server_name: "grpc-server"
receiver:
plugin_name: "grpc-nativeprofile-receiver"
queue:
plugin_name: "memory-queue"
# The maximum buffer event size.
event_buffer_size: ${SATELLITE_QUEUE_EVENT_BUFFER_SIZE:5000}
processor:
filters:
sender:
fallbacker:
plugin_name: none-fallbacker
# The time interval between two flush operations. And the time unit is millisecond.
flush_time: ${SATELLITE_PROFILEPIPE_SENDER_FLUSH_TIME:1000}
# The maximum buffer elements.
max_buffer_size: ${SATELLITE_PROFILEPIPE_SENDER_MAX_BUFFER_SIZE:200}
# The minimum flush elements.
min_flush_events: ${SATELLITE_PROFILEPIPE_SENDER_MIN_FLUSH_EVENTS:1}
client_name: grpc-client
forwarders:
- plugin_name: nativeprofile-grpc-forwarder
- common_config:
pipe_name: cdspipe
gatherer:
server_name: "grpc-server"
receiver:
plugin_name: "grpc-nativecds-receiver"
queue:
plugin_name: "none-queue"
processor:
filters:
sender:
fallbacker:
plugin_name: none-fallbacker
client_name: grpc-client
forwarders:
- plugin_name: nativecds-grpc-forwarder
- common_config:
pipe_name: eventpipe
gatherer:
server_name: "grpc-server"
receiver:
plugin_name: "grpc-nativeevent-receiver"
queue:
plugin_name: "memory-queue"
processor:
filters:
sender:
fallbacker:
plugin_name: none-fallbacker
# The time interval between two flush operations. And the time unit is millisecond.
flush_time: ${SATELLITE_EVENTPIPE_SENDER_FLUSH_TIME:1000}
# The maximum buffer elements.
max_buffer_size: ${SATELLITE_EVENTPIPE_SENDER_MAX_BUFFER_SIZE:200}
# The minimum flush elements.
min_flush_events: ${SATELLITE_EVENTPIPE_SENDER_MIN_FLUSH_EVENTS:1}
client_name: grpc-client
forwarders:
- plugin_name: nativeevent-grpc-forwarder
- common_config:
pipe_name: jvmpipe
gatherer:
server_name: "grpc-server"
receiver:
plugin_name: "grpc-nativejvm-receiver"
queue:
plugin_name: "memory-queue"
processor:
filters:
sender:
fallbacker:
plugin_name: none-fallbacker
# The time interval between two flush operations. And the time unit is millisecond.
flush_time: ${SATELLITE_JVMPIPE_SENDER_FLUSH_TIME:1000}
# The maximum buffer elements.
max_buffer_size: ${SATELLITE_JVMPIPE_SENDER_MAX_BUFFER_SIZE:200}
# The minimum flush elements.
min_flush_events: ${SATELLITE_JVMPIPE_SENDER_MIN_FLUSH_EVENTS:1}
client_name: grpc-client
forwarders:
- plugin_name: nativejvm-grpc-forwarder
- common_config:
pipe_name: meterpipe
gatherer:
server_name: "grpc-server"
receiver:
plugin_name: "grpc-nativemeter-receiver"
queue:
plugin_name: "memory-queue"
processor:
filters:
sender:
fallbacker:
plugin_name: none-fallbacker
# The time interval between two flush operations. And the time unit is millisecond.
flush_time: ${SATELLITE_METERPIPE_SENDER_FLUSH_TIME:1000}
# The maximum buffer elements.
max_buffer_size: ${SATELLITE_METERPIPE_SENDER_MAX_BUFFER_SIZE:200}
# The minimum flush elements.
min_flush_events: ${SATELLITE_METERPIPE_SENDER_MIN_FLUSH_EVENTS:1}
client_name: grpc-client
forwarders:
- plugin_name: nativemeter-grpc-forwarder

View File

@ -23,6 +23,7 @@ services:
environment:
SW_PROMETHEUS_FETCHER: "default"
SW_TELEMETRY: prometheus
SW_METER_ANALYZER_ACTIVE_FILES: satellite
ports:
- 12800
@ -32,9 +33,13 @@ services:
service: provider
ports:
- 9090
environment:
SW_AGENT_COLLECTOR_BACKEND_SERVICES: satellite:11800
depends_on:
oap:
condition: service_healthy
satellite:
condition: service_healthy
consumer:
extends:
@ -42,9 +47,38 @@ services:
service: consumer
ports:
- 9092
environment:
SW_AGENT_COLLECTOR_BACKEND_SERVICES: satellite:11800
depends_on:
provider:
condition: service_healthy
satellite:
build:
context: ../satellite
dockerfile: Dockerfile.satellite
args:
- SW_AGENT_SATELLITE_COMMIT=${SW_AGENT_SATELLITE_COMMIT}
expose:
- 11800
environment:
SATELLITE_GRPC_CLIENT: oap:11800
SATELLITE_LOGPIPE_SENDER_MIN_FLUSH_EVENTS: 1
SW_AGENT_SATELLITE_COMMIT: ${SW_AGENT_SATELLITE_COMMIT}
SATELLITE_TELEMETRY_EXPORT_TYPE: metrics_service
SATELLITE_TELEMETRY_METRICS_SERVICE_INTERVAL: 2
SATELLITE_GRPC_ACCEPT_LIMIT_CPU_UTILIZATION: 100
SATELLITE_TELEMETRY_METRICS_SERVICE_METRIC_PREFIX: sw_stl_
networks:
- e2e
healthcheck:
test: [ "CMD", "sh", "-c", "nc -zn 127.0.0.1 11800" ]
interval: 5s
timeout: 60s
retries: 120
depends_on:
oap:
condition: service_healthy
networks:
e2e:

View File

@ -43,4 +43,5 @@ verify:
cases:
- includes:
- so11y-cases.yaml
- satellite-cases.yaml

View File

@ -0,0 +1,24 @@
# Licensed to 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. Apache Software Foundation (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.
{{- contains .}}
- id: {{ b64enc "satellite::satellite-service" }}.1_{{ b64enc "satellite-instance" }}
name: satellite-instance
attributes: []
language: UNKNOWN
instanceuuid: {{ b64enc "satellite::satellite-service" }}.1_{{ b64enc "satellite-instance" }}
{{- end}}

View File

@ -0,0 +1,20 @@
# 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.
{{- contains . }}
- id: {{ b64enc "satellite::satellite-service" }}.1
name: satellite::satellite-service
group: ""
{{- end }}

View File

@ -0,0 +1,27 @@
# 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.
cases:
# service list
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls
expected: expected/satellite-service.yml
# service instance list
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance list --service-name=satellite::satellite-service
expected: expected/satellite-service-instance.yml
# service instance metrics
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=satellite_instance_server_cpu_utilization --instance-name=satellite-instance --service-name=satellite::satellite-service |yq e 'to_entries' -
expected: expected/metrics-has-value.yml
- query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics linear --name=satellite_instance_grpc_connect_count --instance-name=satellite-instance --service-name=satellite::satellite-service |yq e 'to_entries' -
expected: expected/metrics-has-value.yml

View File

@ -14,7 +14,7 @@
# limitations under the License.
SW_AGENT_JAVA_COMMIT=fbdfc42b4d825ba33205d646ddaaaad20c005cb8
SW_AGENT_SATELLITE_COMMIT=1f3c08a5af19f8522f2a40d9339c45fa816bfe07
SW_AGENT_SATELLITE_COMMIT=1987e1d566ac90f6b58a45fd9bfa27bf8faad635
SW_AGENT_NGINX_LUA_COMMIT=c3cee4841798a147d83b96a10914d4ac0e11d0aa
SW_AGENT_NODEJS_COMMIT=e755659c7f308d3b5589619778c8360308cb14f8
SW_AGENT_GO_COMMIT=4af380c2db6243106b0fc650b6003ce3b3eb82a0