From b28d8dd752c955e6ade993df2f28b8c779ecf9f3 Mon Sep 17 00:00:00 2001 From: Claire Date: Tue, 16 Apr 2024 11:41:53 +0800 Subject: [PATCH] revert skywalking-ui. --- .github/workflows/skywalking.yaml | 2 + docs/en/changes/changes.md | 2 + .../backend/backend-activemq-monitoring.md | 104 ++++ docs/en/swip/SWIP-6.md | 100 ++++ docs/en/swip/readme.md | 1 + docs/menu.yml | 2 + .../oap/server/core/analysis/Layer.java | 7 +- .../ui/template/UITemplateInitializer.java | 1 + .../src/main/resources/application.yml | 2 +- .../otel-rules/activemq/activemq-broker.yaml | 97 ++++ .../otel-rules/activemq/activemq-cluster.yaml | 95 ++++ .../activemq/activemq-destination.yaml | 79 +++ .../activemq/activemq-broker.json | 355 ++++++++++++ .../activemq/activemq-cluster.json | 509 ++++++++++++++++++ .../activemq/activemq-destination.json | 226 ++++++++ .../activemq/activemq-root.json | 46 ++ .../ui-initialized-templates/menu.yaml | 5 + .../e2e-v2/cases/activemq/activemq-cases.yaml | 133 +++++ .../cases/activemq/config/amq/activemq.xml | 130 +++++ .../cases/activemq/config/amq/config.yaml | 34 ++ test/e2e-v2/cases/activemq/docker-compose.yml | 100 ++++ test/e2e-v2/cases/activemq/e2e.yaml | 37 ++ .../cases/activemq/expected/endpoint.yml | 21 + .../cases/activemq/expected/instance.yml | 22 + ...etrics-has-value-label-destinationname.yml | 35 ++ ...etrics-has-value-label-destinationtype.yml | 35 ++ ...rics-has-value-label-serviceinstanceid.yml | 35 ++ .../activemq/expected/metrics-has-value.yml | 31 ++ .../cases/activemq/expected/service.yml | 24 + .../cases/activemq/otel-collector-config.yaml | 43 ++ 30 files changed, 2311 insertions(+), 2 deletions(-) create mode 100644 docs/en/setup/backend/backend-activemq-monitoring.md create mode 100644 docs/en/swip/SWIP-6.md create mode 100644 oap-server/server-starter/src/main/resources/otel-rules/activemq/activemq-broker.yaml create mode 100644 oap-server/server-starter/src/main/resources/otel-rules/activemq/activemq-cluster.yaml create mode 100644 oap-server/server-starter/src/main/resources/otel-rules/activemq/activemq-destination.yaml create mode 100644 oap-server/server-starter/src/main/resources/ui-initialized-templates/activemq/activemq-broker.json create mode 100644 oap-server/server-starter/src/main/resources/ui-initialized-templates/activemq/activemq-cluster.json create mode 100644 oap-server/server-starter/src/main/resources/ui-initialized-templates/activemq/activemq-destination.json create mode 100644 oap-server/server-starter/src/main/resources/ui-initialized-templates/activemq/activemq-root.json create mode 100644 test/e2e-v2/cases/activemq/activemq-cases.yaml create mode 100644 test/e2e-v2/cases/activemq/config/amq/activemq.xml create mode 100644 test/e2e-v2/cases/activemq/config/amq/config.yaml create mode 100644 test/e2e-v2/cases/activemq/docker-compose.yml create mode 100644 test/e2e-v2/cases/activemq/e2e.yaml create mode 100644 test/e2e-v2/cases/activemq/expected/endpoint.yml create mode 100644 test/e2e-v2/cases/activemq/expected/instance.yml create mode 100644 test/e2e-v2/cases/activemq/expected/metrics-has-value-label-destinationname.yml create mode 100644 test/e2e-v2/cases/activemq/expected/metrics-has-value-label-destinationtype.yml create mode 100644 test/e2e-v2/cases/activemq/expected/metrics-has-value-label-serviceinstanceid.yml create mode 100644 test/e2e-v2/cases/activemq/expected/metrics-has-value.yml create mode 100644 test/e2e-v2/cases/activemq/expected/service.yml create mode 100644 test/e2e-v2/cases/activemq/otel-collector-config.yaml diff --git a/.github/workflows/skywalking.yaml b/.github/workflows/skywalking.yaml index f773a07b6a7c..8090e957a535 100644 --- a/.github/workflows/skywalking.yaml +++ b/.github/workflows/skywalking.yaml @@ -650,6 +650,8 @@ jobs: config: test/e2e-v2/cases/rocketmq/e2e.yaml - name: ClickHouse config: test/e2e-v2/cases/clickhouse/clickhouse-prometheus-endpoint/e2e.yaml + - name: ActiveMQ + config: test/e2e-v2/cases/activemq/e2e.yaml - name: UI Menu BanyanDB config: test/e2e-v2/cases/menu/banyandb/e2e.yaml diff --git a/docs/en/changes/changes.md b/docs/en/changes/changes.md index c5307685083a..6e7bde8b3419 100644 --- a/docs/en/changes/changes.md +++ b/docs/en/changes/changes.md @@ -105,6 +105,7 @@ - `memory_swap_percentage` -> `memory_virtual_memory_percentage` * Fix/Change UI init setting for Windows Swap -> Virtual Memory * Fix `Memory Swap Usage`/`Virtual Memory Usage` display with UI init.(Linux/Windows) +* Support Apache ActiveMQ server monitoring. #### UI @@ -163,5 +164,6 @@ * Remove `OpenTelemetry Exporter` support from meter doc, as this has been flagged as unmaintained on OTEL upstream. * Add doc of one-line quick start script for different storage types. * Add FAQ for `Why is Clickhouse or Loki or xxx not supported as a storage option?`. +* Add `SWIP-6 Support ActiveMQ Monitoring`. All issues and pull requests are [here](https://github.com/apache/skywalking/milestone/202?closed=1) diff --git a/docs/en/setup/backend/backend-activemq-monitoring.md b/docs/en/setup/backend/backend-activemq-monitoring.md new file mode 100644 index 000000000000..9ec85d70873c --- /dev/null +++ b/docs/en/setup/backend/backend-activemq-monitoring.md @@ -0,0 +1,104 @@ +# ActiveMQ classic monitoring + +SkyWalking leverages jmx prometheus exporter for collecting metrics data from ActiveMQ classic. It leverages OpenTelemetry +Collector to transfer the metrics to +[OpenTelemetry receiver](opentelemetry-receiver.md) and into the [Meter System](./../../concepts-and-designs/meter.md). + +## Data flow + +1. ActiveMQ classic has extensive support for JMX to allow you to monitor and control the behavior of the broker via the JMX MBeans. +2. The [jmx prometheus exporter](https://github.com/prometheus/jmx_exporter) collects metrics data from ActiveMQ classic, this exporter is intended to be run as a Java Agent, exposing a HTTP server and serving metrics of the local JVM. +3. OpenTelemetry Collector fetches metrics from jmx prometheus exporter via Prometheus Receiver and pushes metrics to + SkyWalking OAP Server via OpenTelemetry gRPC exporter. +4. The SkyWalking OAP Server parses the expression with [MAL](../../concepts-and-designs/mal.md) to + filter/calculate/aggregate and store the results. + +## Setup + +1. Setup [jmx prometheus exporter](https://github.com/prometheus/jmx_exporter) which runs as a Java Agent(recommended) of ActiveMQ classic.If you work with docker, [refer here](https://github.com/bitnami/containers/tree/main/bitnami/jmx-exporter) for docker deployment. +2. Set up [OpenTelemetry Collector](https://opentelemetry.io/docs/collector/getting-started/#docker). The example for OpenTelemetry Collector configuration, refer + to [here](../../../../test/e2e-v2/cases/activemq/otel-collector-config.yaml). +3. Config SkyWalking [OpenTelemetry receiver](opentelemetry-receiver.md). + +## ActiveMQ classic Monitoring + +ActiveMQ classic monitoring provides multidimensional metrics monitoring of ActiveMQ Exporter as `Layer: ActiveMQ` `Service` in +the OAP. In each cluster, the broker is represented as `Instance` and the destination is represented as `Endpoint`. + +### ActiveMQ Cluster Supported Metrics + +| Monitoring Panel |Unit | Metric Name | Description | Data Source | +|--------------------------------------------|------------|-------------------------------------------------------------------------|---------------------------------------------------------------------------------------|-------------------------| +| System Load Average | Count | meter_activemq_cluster_system_load_average | The average system load, range:[0, 10000]. | JMX Prometheus Exporter | +| Thread Count | Count | meter_activemq_cluster_thread_count | Threads currently used by the JVM. | JMX Prometheus Exporter | +| Init Heap Memory Usage | Bytes | meter_activemq_cluster_heap_memory_usage_init | The initial amount of heap memory available. | JMX Prometheus Exporter | +| Committed Heap Memory Usage | Bytes | meter_activemq_cluster_heap_memory_usage_committed | The memory is guaranteed to be available for the JVM to use. | JMX Prometheus Exporter | +| Used Heap Memory Usage | Bytes | meter_activemq_cluster_heap_memory_usage_used | The amount of JVM heap memory currently in use. | JMX Prometheus Exporter | +| Max Heap Memory Usage | Bytes | meter_activemq_cluster_heap_memory_usage_max | The maximum possible size of the heap memory. | JMX Prometheus Exporter | +| GC G1 Old Collection Count | Count | meter_activemq_cluster_gc_g1_old_collection_count | The gc count of G1 Old Generation(JDK[9,17]). | JMX Prometheus Exporter | +| GC G1 Young Collection Count | Count | meter_activemq_cluster_gc_g1_young_collection_count | The gc count of G1 Young Generation(JDK[9,17]). | JMX Prometheus Exporter | +| GC G1 Old Collection Time | ms | meter_activemq_cluster_gc_g1_old_collection_time | The gc time spent in G1 Old Generation in milliseconds(JDK[9,17]). | JMX Prometheus Exporter | +| GC G1 Young Collection Time | ms | meter_activemq_cluster_gc_g1_young_collection_time | The gc time spent in G1 Young Generation in milliseconds(JDK[9,17]). | JMX Prometheus Exporter | +| GC Parallel Old Collection Count | Count | meter_activemq_cluster_gc_parallel_old_collection_count | The gc count of Parallel Old Generation(JDK[6,8]). | JMX Prometheus Exporter | +| GC Parallel Young Collection Count | Count | meter_activemq_cluster_gc_parallel_young_collection_count | The gc count of Parallel Young Generation(JDK[6,8]). | JMX Prometheus Exporter | +| GC Parallel Old Collection Time | ms | meter_activemq_cluster_gc_parallel_old_collection_time | The gc time spent in Parallel Old Generation in milliseconds(JDK[6,8]). | JMX Prometheus Exporter | +| GC Parallel Young Collection Time | ms | meter_activemq_cluster_gc_parallel_young_collection_time | The gc time spent in Parallel Young Generation in milliseconds(JDK[6,8]). | JMX Prometheus Exporter | +| Enqueue Rate | Count/s | meter_activemq_cluster_enqueue_rate | Number of messages that have been sent to the cluster per second(JDK[6,8]). | JMX Prometheus Exporter | +| Dequeue Rate | Count/s | meter_activemq_cluster_dequeue_rate | Number of messages that have been acknowledged or discarded on the cluster per second.| JMX Prometheus Exporter | +| Dispatch Rate | Count/s | meter_activemq_cluster_dispatch_rate | Number of messages that has been delivered to consumers per second. | JMX Prometheus Exporter | +| Expired Rate | Count/s | meter_activemq_cluster_expired_rate | Number of messages that have been expired per second. | JMX Prometheus Exporter | +| Average Enqueue Time | ms | meter_activemq_cluster_average_enqueue_time | The average time a message was held on this cluster. | JMX Prometheus Exporter | +| Max Enqueue Time | ms | meter_activemq_cluster_max_enqueue_time | The max time a message was held on this cluster. | JMX Prometheus Exporter | + +### ActiveMQ Broker Supported Metrics + +| Monitoring Panel |Unit | Metric Name | Description | Data Source | +|--------------------------------------------|-----------|-------------------------------------------------------------------------|----------------------------------------------------------------------------------------------- |-------------------------| +| Uptime | sec | meter_activemq_broker_uptime | Uptime of the broker in day. | JMX Prometheus Exporter | +| State | | meter_activemq_broker_state | If slave broker 1 else 0. | JMX Prometheus Exporter | +| Current Connentions | Count | meter_activemq_broker_current_connentions | The number of clients connected to the broker currently. | JMX Prometheus Exporter | +| Current Producer Count | Count | meter_activemq_broker_current_producer_count | The number of producers currently attached to the broker. | JMX Prometheus Exporter | +| Current Consumer Count | Count | meter_activemq_broker_current_consumer_count | The number of consumers consuming messages from the broker. | JMX Prometheus Exporter | +| Producer Count | Count | meter_activemq_broker_producer_count | Number of message producers active on destinations. | JMX Prometheus Exporter | +| Consumer Count | Count | meter_activemq_broker_consumer_count | Number of message consumers subscribed to destinations. | JMX Prometheus Exporter | +| Enqueue Count | Count | meter_activemq_broker_enqueue_count | The total number of messages sent to the broker. | JMX Prometheus Exporter | +| Dequeue Count | Count | meter_activemq_broker_dequeue_count | The total number of messages the broker has delivered to consumers. | JMX Prometheus Exporter | +| Enqueue Rate | Count/sec | meter_activemq_broker_enqueue_rate | The total number of messages sent to the broker per second. | JMX Prometheus Exporter | +| Dequeue Rate | Count/sec | meter_activemq_broker_dequeue_rate | The total number of messages the broker has delivered to consumers per second. | JMX Prometheus Exporter | +| Memory Percent Usage | % | meter_activemq_broker_memory_percent_usage | Percentage of configured memory used by the broker. | JMX Prometheus Exporter | +| Memory Usage | Bytes | meter_activemq_broker_memory_percent_usage | Memory used by undelivered messages in bytes. | JMX Prometheus Exporter | +| Memory Limit | Bytes | meter_activemq_broker_memory_limit | Memory limited used for holding undelivered messages before paging to temporary storage. | JMX Prometheus Exporter | +| Store Percent Usage | % | meter_activemq_broker_store_percent_usage | Percentage of available disk space used for persistent message storage. | JMX Prometheus Exporter | +| Store Limit | Bytes | meter_activemq_broker_store_limit | Disk limited used for persistent messages before producers are blocked. | JMX Prometheus Exporter | +| Temp Percent Usage | Bytes | meter_activemq_broker_temp_percent_usage | Percentage of available disk space used for non-persistent message storage. | JMX Prometheus Exporter | +| Temp Limit | Bytes | meter_activemq_broker_temp_limit | Disk limited used for non-persistent messages and temporary data before producers are blocked. | JMX Prometheus Exporter | +| Average Message Size | Bytes | meter_activemq_broker_average_message_size | Average message size on this broker. | JMX Prometheus Exporter | +| Max Message Size | Bytes | meter_activemq_broker_max_message_size | Max message size on this broker. | JMX Prometheus Exporter | +| Queue Size | Count | meter_activemq_broker_queue_size | Number of messages on this broker that have been dispatched but not acknowledged. | JMX Prometheus Exporter | + +### ActiveMQ Destination Supported Metrics + +| Monitoring Panel |Unit | Metric Name | Description | Data Source | +|--------------------------------------------|------------|-------------------------------------------------------------------------|-----------------------------------------------------------------------------------------|-------------------------| +| Producer Count | Count | meter_activemq_destination_producer_count | Number of producers attached to this destination. | JMX Prometheus Exporter | +| Consumer Count | Count | meter_activemq_destination_consumer_count | Number of consumers subscribed to this destination. | JMX Prometheus Exporter | +| Topic Consumer Count | Count | meter_activemq_destination_topic_consumer_count | Number of consumers subscribed to the topics. | JMX Prometheus Exporter | +| Queue Size | Count | meter_activemq_destination_queue_size | The number of messages that have not been acknowledged by a consumer. | JMX Prometheus Exporter | +| Memory Usage | Bytes | meter_activemq_destination_memory_usage | Memory used by undelivered messages in bytes. | JMX Prometheus Exporter | +| Memory Percent Usage | % | meter_activemq_destination_memory_percent_usage | Percentage of configured memory used by the destination. | JMX Prometheus Exporter | +| Enqueue Count | Count | meter_activemq_destination_enqueue_count | The number of messages sent to the destination. | JMX Prometheus Exporter | +| Dequeue Count | Count | meter_activemq_destination_dequeue_count | The number of messages the destination has delivered to consumers. | JMX Prometheus Exporter | +| Average Enqueue Time | ms | meter_activemq_destination_average_enqueue_time | The average time a message was held on this destination. | JMX Prometheus Exporter | +| Max Enqueue Time | ms | meter_activemq_destination_max_enqueue_time | The max time a message was held on this destination. | JMX Prometheus Exporter | +| Dispatch Count | Count | meter_activemq_destination_dispatch_count | Number of messages that has been delivered to consumers. | JMX Prometheus Exporter | +| Expired Count | Count | meter_activemq_destination_expired_count | Number of messages that have been expired. | JMX Prometheus Exporter | +| Inflight Count | Count | meter_activemq_destination_inflight_count | Number of messages that have been dispatched to but not acknowledged by consumers. | JMX Prometheus Exporter | +| Average Message Size | Bytes | meter_activemq_destination_average_message_size | Average message size on this destination. | JMX Prometheus Exporter | +| Max Message Size | Bytes | meter_activemq_destination_max_message_size | Max message size on this destination. | JMX Prometheus Exporter | + +## Customizations + +You can customize your own metrics/expression/dashboard panel. +The metrics definition and expression rules are found +in `otel-rules/activemq/activemq-cluster.yaml, otel-rules/activemq/activemq-broker.yaml, otel-rules/activemq/activemq-destination.yaml`. +The ActiveMQ dashboard panel configurations are found in `ui-initialized-templates/activemq`. \ No newline at end of file diff --git a/docs/en/swip/SWIP-6.md b/docs/en/swip/SWIP-6.md new file mode 100644 index 000000000000..6c598e0f7eac --- /dev/null +++ b/docs/en/swip/SWIP-6.md @@ -0,0 +1,100 @@ +# Support ActiveMQ classic Monitoring + +## Motivation + +[Apache ActiveMQ Classic](https://activemq.apache.org/components/classic/) is a popular and powerful open source messaging and Integration Patterns server. It supports many Cross Language Clients and Protocols, comes with easy to use Enterprise Integration Patterns and many advanced features. + +Now I want to add ActiveMQ Classic monitoring via the [OpenTelemetry Collector](https://opentelemetry.io/docs) which fetches metrics from [jmx prometheus exporter](https://github.com/prometheus/jmx_exporter) run as a Java Agent. + +## Architecture Graph + +There is no significant architecture-level change. + +## Proposed Changes + +`Apache ActiveMQ Classic` has extensive support for JMX to allow you to monitor and control the behavior of the broker via the JMX MBeans. + +[Jmx prometheus exporter](https://github.com/prometheus/jmx_exporter) collects metrics data from ActiveMQ classic, this exporter is intended to be run as a Java Agent, exposing a HTTP server and serving metrics of the local JVM. + +Using openTelemetry receiver to fetch these metrics to SkyWalking OAP server. + +### ActiveMQ Cluster Supported Metrics + +| Monitoring Panel |Unit | Metric Name | Description | Data Source | +|--------------------------------------------|------------|-------------------------------------------------------------------------|---------------------------------------------------------------------------------------|-------------------------| +| System Load Average | Count | meter_activemq_cluster_system_load_average | The average system load, range:[0, 10000]. | JMX Prometheus Exporter | +| Thread Count | Count | meter_activemq_cluster_thread_count | Threads currently used by the JVM. | JMX Prometheus Exporter | +| Init Heap Memory Usage | Bytes | meter_activemq_cluster_heap_memory_usage_init | The initial amount of heap memory available. | JMX Prometheus Exporter | +| Committed Heap Memory Usage | Bytes | meter_activemq_cluster_heap_memory_usage_committed | The memory is guaranteed to be available for the JVM to use. | JMX Prometheus Exporter | +| Used Heap Memory Usage | Bytes | meter_activemq_cluster_heap_memory_usage_used | The amount of JVM heap memory currently in use. | JMX Prometheus Exporter | +| Max Heap Memory Usage | Bytes | meter_activemq_cluster_heap_memory_usage_max | The maximum possible size of the heap memory. | JMX Prometheus Exporter | +| GC G1 Old Collection Count | Count | meter_activemq_cluster_gc_g1_old_collection_count | The gc count of G1 Old Generation(JDK[9,17]). | JMX Prometheus Exporter | +| GC G1 Young Collection Count | Count | meter_activemq_cluster_gc_g1_young_collection_count | The gc count of G1 Young Generation(JDK[9,17]). | JMX Prometheus Exporter | +| GC G1 Old Collection Time | ms | meter_activemq_cluster_gc_g1_old_collection_time | The gc time spent in G1 Old Generation in milliseconds(JDK[9,17]). | JMX Prometheus Exporter | +| GC G1 Young Collection Time | ms | meter_activemq_cluster_gc_g1_young_collection_time | The gc time spent in G1 Young Generation in milliseconds(JDK[9,17]). | JMX Prometheus Exporter | +| GC Parallel Old Collection Count | Count | meter_activemq_cluster_gc_parallel_old_collection_count | The gc count of Parallel Old Generation(JDK[6,8]). | JMX Prometheus Exporter | +| GC Parallel Young Collection Count | Count | meter_activemq_cluster_gc_parallel_young_collection_count | The gc count of Parallel Young Generation(JDK[6,8]). | JMX Prometheus Exporter | +| GC Parallel Old Collection Time | ms | meter_activemq_cluster_gc_parallel_old_collection_time | The gc time spent in Parallel Old Generation in milliseconds(JDK[6,8]). | JMX Prometheus Exporter | +| GC Parallel Young Collection Time | ms | meter_activemq_cluster_gc_parallel_young_collection_time | The gc time spent in Parallel Young Generation in milliseconds(JDK[6,8]). | JMX Prometheus Exporter | +| Enqueue Rate | Count/s | meter_activemq_cluster_enqueue_rate | Number of messages that have been sent to the cluster per second(JDK[6,8]). | JMX Prometheus Exporter | +| Dequeue Rate | Count/s | meter_activemq_cluster_dequeue_rate | Number of messages that have been acknowledged or discarded on the cluster per second.| JMX Prometheus Exporter | +| Dispatch Rate | Count/s | meter_activemq_cluster_dispatch_rate | Number of messages that has been delivered to consumers per second. | JMX Prometheus Exporter | +| Expired Rate | Count/s | meter_activemq_cluster_expired_rate | Number of messages that have been expired per second. | JMX Prometheus Exporter | +| Average Enqueue Time | ms | meter_activemq_cluster_average_enqueue_time | The average time a message was held on this cluster. | JMX Prometheus Exporter | +| Max Enqueue Time | ms | meter_activemq_cluster_max_enqueue_time | The max time a message was held on this cluster. | JMX Prometheus Exporter | + +### ActiveMQ Broker Supported Metrics + +| Monitoring Panel |Unit | Metric Name | Description | Data Source | +|--------------------------------------------|-----------|-------------------------------------------------------------------------|----------------------------------------------------------------------------------------------- |-------------------------| +| Uptime | sec | meter_activemq_broker_uptime | Uptime of the broker in day. | JMX Prometheus Exporter | +| State | | meter_activemq_broker_state | If slave broker 1 else 0. | JMX Prometheus Exporter | +| Current Connentions | Count | meter_activemq_broker_current_connentions | The number of clients connected to the broker currently. | JMX Prometheus Exporter | +| Current Producer Count | Count | meter_activemq_broker_current_producer_count | The number of producers currently attached to the broker. | JMX Prometheus Exporter | +| Current Consumer Count | Count | meter_activemq_broker_current_consumer_count | The number of consumers consuming messages from the broker. | JMX Prometheus Exporter | +| Producer Count | Count | meter_activemq_broker_producer_count | Number of message producers active on destinations. | JMX Prometheus Exporter | +| Consumer Count | Count | meter_activemq_broker_consumer_count | Number of message consumers subscribed to destinations. | JMX Prometheus Exporter | +| Enqueue Count | Count | meter_activemq_broker_enqueue_count | The total number of messages sent to the broker. | JMX Prometheus Exporter | +| Dequeue Count | Count | meter_activemq_broker_dequeue_count | The total number of messages the broker has delivered to consumers. | JMX Prometheus Exporter | +| Enqueue Rate | Count/sec | meter_activemq_broker_enqueue_rate | The total number of messages sent to the broker per second. | JMX Prometheus Exporter | +| Dequeue Rate | Count/sec | meter_activemq_broker_dequeue_rate | The total number of messages the broker has delivered to consumers per second. | JMX Prometheus Exporter | +| Memory Percent Usage | % | meter_activemq_broker_memory_percent_usage | Percentage of configured memory used by the broker. | JMX Prometheus Exporter | +| Memory Usage | Bytes | meter_activemq_broker_memory_percent_usage | Memory used by undelivered messages in bytes. | JMX Prometheus Exporter | +| Memory Limit | Bytes | meter_activemq_broker_memory_limit | Memory limited used for holding undelivered messages before paging to temporary storage. | JMX Prometheus Exporter | +| Store Percent Usage | % | meter_activemq_broker_store_percent_usage | Percentage of available disk space used for persistent message storage. | JMX Prometheus Exporter | +| Store Limit | Bytes | meter_activemq_broker_store_limit | Disk limited used for persistent messages before producers are blocked. | JMX Prometheus Exporter | +| Temp Percent Usage | Bytes | meter_activemq_broker_temp_percent_usage | Percentage of available disk space used for non-persistent message storage. | JMX Prometheus Exporter | +| Temp Limit | Bytes | meter_activemq_broker_temp_limit | Disk limited used for non-persistent messages and temporary data before producers are blocked. | JMX Prometheus Exporter | +| Average Message Size | Bytes | meter_activemq_broker_average_message_size | Average message size on this broker. | JMX Prometheus Exporter | +| Max Message Size | Bytes | meter_activemq_broker_max_message_size | Max message size on this broker. | JMX Prometheus Exporter | +| Queue Size | Count | meter_activemq_broker_queue_size | Number of messages on this broker that have been dispatched but not acknowledged. | JMX Prometheus Exporter | + +### ActiveMQ Destination Supported Metrics + +| Monitoring Panel |Unit | Metric Name | Description | Data Source | +|--------------------------------------------|------------|-------------------------------------------------------------------------|-----------------------------------------------------------------------------------------|-------------------------| +| Producer Count | Count | meter_activemq_destination_producer_count | Number of producers attached to this destination. | JMX Prometheus Exporter | +| Consumer Count | Count | meter_activemq_destination_consumer_count | Number of consumers subscribed to this destination. | JMX Prometheus Exporter | +| Topic Consumer Count | Count | meter_activemq_destination_topic_consumer_count | Number of consumers subscribed to the topics. | JMX Prometheus Exporter | +| Queue Size | Count | meter_activemq_destination_queue_size | The number of messages that have not been acknowledged by a consumer. | JMX Prometheus Exporter | +| Memory Usage | Bytes | meter_activemq_destination_memory_usage | Memory used by undelivered messages in bytes. | JMX Prometheus Exporter | +| Memory Percent Usage | % | meter_activemq_destination_memory_percent_usage | Percentage of configured memory used by the destination. | JMX Prometheus Exporter | +| Enqueue Count | Count | meter_activemq_destination_enqueue_count | The number of messages sent to the destination. | JMX Prometheus Exporter | +| Dequeue Count | Count | meter_activemq_destination_dequeue_count | The number of messages the destination has delivered to consumers. | JMX Prometheus Exporter | +| Average Enqueue Time | ms | meter_activemq_destination_average_enqueue_time | The average time a message was held on this destination. | JMX Prometheus Exporter | +| Max Enqueue Time | ms | meter_activemq_destination_max_enqueue_time | The max time a message was held on this destination. | JMX Prometheus Exporter | +| Dispatch Count | Count | meter_activemq_destination_dispatch_count | Number of messages that has been delivered to consumers. | JMX Prometheus Exporter | +| Expired Count | Count | meter_activemq_destination_expired_count | Number of messages that have been expired. | JMX Prometheus Exporter | +| Inflight Count | Count | meter_activemq_destination_inflight_count | Number of messages that have been dispatched to but not acknowledged by consumers. | JMX Prometheus Exporter | +| Average Message Size | Bytes | meter_activemq_destination_average_message_size | Average message size on this destination. | JMX Prometheus Exporter | +| Max Message Size | Bytes | meter_activemq_destination_max_message_size | Max message size on this destination. | JMX Prometheus Exporter | + +## Imported Dependencies libs and their licenses. + +No new dependency. + +## Compatibility + +no breaking changes. + +## General usage docs diff --git a/docs/en/swip/readme.md b/docs/en/swip/readme.md index 709749a83ae0..60c2fe4d7db2 100644 --- a/docs/en/swip/readme.md +++ b/docs/en/swip/readme.md @@ -72,6 +72,7 @@ Next SWIP Number: 6 ### Accepted SWIPs +- [SWIP-6 Support ActiveMQ Monitoring](SWIP-6.md) - [SWIP-5 Support ClickHouse Monitoring](SWIP-5.md) - [SWIP-4 Support available layers of service in the topology](SWIP-4.md) - [SWIP-3 Support RocketMQ Monitoring](SWIP-3.md) diff --git a/docs/menu.yml b/docs/menu.yml index e99a6d8f9ffc..4b5a130367b5 100644 --- a/docs/menu.yml +++ b/docs/menu.yml @@ -264,6 +264,8 @@ catalog: path: "/en/setup/backend/backend-pulsar-monitoring" - name: "RocketMQ" path: "/en/setup/backend/backend-rocketmq-monitoring" + - name: "ActiveMQ" + path: "/en/setup/backend/backend-activemq-monitoring" - name: "Self Observability" catalog: - name: "OAP self telemetry" diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/Layer.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/Layer.java index 7de44badee7e..fd77ac782f74 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/Layer.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/Layer.java @@ -223,7 +223,12 @@ public enum Layer { /** * A high-performance, column-oriented SQL database management system (DBMS) for online analytical processing (OLAP). */ - CLICKHOUSE(36, true); + CLICKHOUSE(36, true), + + /** + * ActiveMQ is a popular open source, multi-protocol, Java-based message broker. + */ + ACTIVEMQ(37, true); private final int value; /** diff --git a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/management/ui/template/UITemplateInitializer.java b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/management/ui/template/UITemplateInitializer.java index 275404765200..b37c5828e9df 100644 --- a/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/management/ui/template/UITemplateInitializer.java +++ b/oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/management/ui/template/UITemplateInitializer.java @@ -74,6 +74,7 @@ public class UITemplateInitializer { Layer.NGINX.name(), Layer.ROCKETMQ.name(), Layer.CLICKHOUSE.name(), + Layer.ACTIVEMQ.name(), "custom" }; private final UITemplateManagementService uiTemplateManagementService; diff --git a/oap-server/server-starter/src/main/resources/application.yml b/oap-server/server-starter/src/main/resources/application.yml index ff1a4a5de094..9c8d5d417267 100644 --- a/oap-server/server-starter/src/main/resources/application.yml +++ b/oap-server/server-starter/src/main/resources/application.yml @@ -353,7 +353,7 @@ receiver-otel: selector: ${SW_OTEL_RECEIVER:default} default: enabledHandlers: ${SW_OTEL_RECEIVER_ENABLED_HANDLERS:"otlp-metrics,otlp-logs"} - enabledOtelMetricsRules: ${SW_OTEL_RECEIVER_ENABLED_OTEL_METRICS_RULES:"apisix,nginx/*,k8s/*,istio-controlplane,vm,mysql/*,postgresql/*,oap,aws-eks/*,windows,aws-s3/*,aws-dynamodb/*,aws-gateway/*,redis/*,elasticsearch/*,rabbitmq/*,mongodb/*,kafka/*,pulsar/*,bookkeeper/*,rocketmq/*,clickhouse/*"} + enabledOtelMetricsRules: ${SW_OTEL_RECEIVER_ENABLED_OTEL_METRICS_RULES:"apisix,nginx/*,k8s/*,istio-controlplane,vm,mysql/*,postgresql/*,oap,aws-eks/*,windows,aws-s3/*,aws-dynamodb/*,aws-gateway/*,redis/*,elasticsearch/*,rabbitmq/*,mongodb/*,kafka/*,pulsar/*,bookkeeper/*,rocketmq/*,clickhouse/*,activemq/*"} receiver-zipkin: selector: ${SW_RECEIVER_ZIPKIN:-} diff --git a/oap-server/server-starter/src/main/resources/otel-rules/activemq/activemq-broker.yaml b/oap-server/server-starter/src/main/resources/otel-rules/activemq/activemq-broker.yaml new file mode 100644 index 000000000000..c3a2cd20e899 --- /dev/null +++ b/oap-server/server-starter/src/main/resources/otel-rules/activemq/activemq-broker.yaml @@ -0,0 +1,97 @@ +# 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. + +# This will parse a textual representation of a duration. The formats +# accepted are based on the ISO-8601 duration format {@code PnDTnHnMn.nS} +# with days considered to be exactly 24 hours. +#

+# Examples: +#

+#    "PT20.345S" -- parses as "20.345 seconds"
+#    "PT15M"     -- parses as "15 minutes" (where a minute is 60 seconds)
+#    "PT10H"     -- parses as "10 hours" (where an hour is 3600 seconds)
+#    "P2D"       -- parses as "2 days" (where a day is 24 hours or 86400 seconds)
+#    "P2DT3H4M"  -- parses as "2 days, 3 hours and 4 minutes"
+#    "P-6H3M"    -- parses as "-6 hours and +3 minutes"
+#    "-P6H3M"    -- parses as "-6 hours and -3 minutes"
+#    "-P-6H+3M"  -- parses as "+6 hours and -3 minutes"
+# 
+filter: "{ tags -> tags.job_name == 'activemq-monitoring' }" # The OpenTelemetry job name +expSuffix: tag({tags -> tags.cluster = 'activemq::' + tags.cluster}).instance(['cluster'], ['brokerName'], Layer.ACTIVEMQ) +metricPrefix: meter_activemq_broker +metricsRules: + # Uptime of the broker in day. + - name: uptime + exp: org_apache_activemq_Broker_UptimeMillis.max(['cluster','brokerName','service_instance_id']) + # If slave broker 1 else 0. + - name: state + exp: org_apache_activemq_Broker_Slave.sum(['cluster','brokerName','service_instance_id']) + # The number of clients connected to the broker currently. + - name: current_connentions + exp: org_apache_activemq_Broker_CurrentConnectionsCount.sum(['cluster','brokerName','service_instance_id']) + # The number of producers currently attached to the broker. + - name: current_producer_count + exp: org_apache_activemq_Broker_ProducerCount.sum(['cluster','brokerName','service_instance_id']) + # The number of consumers consuming messages from the broker. + - name: current_consumer_count + exp: org_apache_activemq_Broker_ConsumerCount.sum(['cluster','brokerName','service_instance_id']) + # Number of message producers active on destinations. + - name: producer_count + exp: org_apache_activemq_Broker_TotalProducerCount.sum(['cluster','brokerName','service_instance_id']).increase("PT1M") + # Number of message consumers subscribed to destinations. + - name: consumer_count + exp: org_apache_activemq_Broker_TotalConsumerCount.sum(['cluster','brokerName','service_instance_id']).increase("PT1M") + # The total number of messages sent to the broker. + - name: enqueue_count + exp: org_apache_activemq_Broker_TotalEnqueueCount.sum(['cluster','brokerName','service_instance_id']).increase("PT1M") + # The total number of messages the broker has delivered to consumers. + - name: dequeue_count + exp: org_apache_activemq_Broker_TotalDequeueCount.sum(['cluster','brokerName','service_instance_id']).increase("PT1M") + # The total number of messages sent to the broker per second. + - name: enqueue_rate + exp: org_apache_activemq_Broker_TotalEnqueueCount.sum(['cluster','brokerName','service_instance_id']).rate("PT1M") + # The total number of messages the broker has delivered to consumers per second. + - name: dequeue_rate + exp: org_apache_activemq_Broker_TotalDequeueCount.sum(['cluster','brokerName','service_instance_id']).rate("PT1M") + # Percentage of configured memory used by the broker. + - name: memory_percent_usage + exp: org_apache_activemq_Broker_MemoryPercentUsage.sum(['cluster','brokerName','service_instance_id']) + # Memory used by undelivered messages in bytes. + - name: memory_usage + exp: org_apache_activemq_Broker_MemoryUsageByteCount.sum(['cluster','brokerName','service_instance_id']) + # Memory limited used for holding undelivered messages before paging to temporary storage. + - name: memory_limit + exp: org_apache_activemq_Broker_MemoryLimit.sum(['cluster','brokerName','service_instance_id']) + # Percentage of available disk space used for persistent message storage. + - name: store_percent_usage + exp: org_apache_activemq_Broker_StorePercentUsage.sum(['cluster','brokerName','service_instance_id']) + # Disk limited used for persistent messages before producers are blocked. + - name: store_limit + exp: org_apache_activemq_Broker_StoreLimit.sum(['cluster','brokerName','service_instance_id']) + # Percentage of available disk space used for non-persistent message storage. + - name: temp_percent_usage + exp: org_apache_activemq_Broker_TempPercentUsage.sum(['cluster','brokerName','service_instance_id']) + # Disk limited used for non-persistent messages and temporary data before producers are blocked. + - name: temp_limit + exp: org_apache_activemq_Broker_TempLimit.sum(['cluster','brokerName','service_instance_id']) + # Average message size on this broker. + - name: average_message_size + exp: org_apache_activemq_Broker_AverageMessageSize.avg(['cluster','brokerName','service_instance_id']) + # Max message size on this broker. + - name: max_message_size + exp: org_apache_activemq_Broker_MaxMessageSize.max(['cluster','brokerName','service_instance_id']) + # Number of messages on this broker that have been dispatched but not acknowledged. + - name: queue_size + exp: org_apache_activemq_Broker_QueueSize.sum(['cluster','brokerName','destinationName']) diff --git a/oap-server/server-starter/src/main/resources/otel-rules/activemq/activemq-cluster.yaml b/oap-server/server-starter/src/main/resources/otel-rules/activemq/activemq-cluster.yaml new file mode 100644 index 000000000000..a3c2e393f496 --- /dev/null +++ b/oap-server/server-starter/src/main/resources/otel-rules/activemq/activemq-cluster.yaml @@ -0,0 +1,95 @@ +# 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. + +# This will parse a textual representation of a duration. The formats +# accepted are based on the ISO-8601 duration format {@code PnDTnHnMn.nS} +# with days considered to be exactly 24 hours. +#

+# Examples: +#

+#    "PT20.345S" -- parses as "20.345 seconds"
+#    "PT15M"     -- parses as "15 minutes" (where a minute is 60 seconds)
+#    "PT10H"     -- parses as "10 hours" (where an hour is 3600 seconds)
+#    "P2D"       -- parses as "2 days" (where a day is 24 hours or 86400 seconds)
+#    "P2DT3H4M"  -- parses as "2 days, 3 hours and 4 minutes"
+#    "P-6H3M"    -- parses as "-6 hours and +3 minutes"
+#    "-P6H3M"    -- parses as "-6 hours and -3 minutes"
+#    "-P-6H+3M"  -- parses as "+6 hours and -3 minutes"
+# 
+ +filter: "{ tags -> tags.job_name == 'activemq-monitoring' }" # The OpenTelemetry job name +expSuffix: tag({tags -> tags.cluster = 'activemq::' + tags.cluster}).service(['cluster'], Layer.ACTIVEMQ) +metricPrefix: meter_activemq_cluster +metricsRules: + # The average system load, range:[0,10000]. + - name: system_load_average + exp: java_lang_OperatingSystem_SystemLoadAverage.avg(['cluster','service_instance_id'])*10000 + # Threads currently used by the JVM. + - name: thread_count + exp: java_lang_Threading_ThreadCount.sum(['cluster','service_instance_id']) + # The initial amount of heap memory available. + - name: heap_memory_usage_init + exp: java_lang_Memory_HeapMemoryUsage_init.sum(['cluster','service_instance_id']) + # The memory is guaranteed to be available for the JVM to use. + - name: heap_memory_usage_committed + exp: java_lang_Memory_HeapMemoryUsage_committed.sum(['cluster','service_instance_id']) + # The amount of JVM heap memory currently in use. + - name: heap_memory_usage_used + exp: java_lang_Memory_HeapMemoryUsage_used.sum(['cluster','service_instance_id']) + # The maximum possible size of the heap memory. + - name: heap_memory_usage_max + exp: java_lang_Memory_HeapMemoryUsage_max.sum(['cluster','service_instance_id']) + # The gc count of G1 Old Generation(JDK[9,17]). + - name: gc_g1_old_collection_count + exp: java_lang_G1_Old_Generation_CollectionCount.tagEqual('type','GarbageCollector').sum(['cluster','service_instance_id']).increase("PT1M") + # The gc count of G1 Young Generation(JDK[9,17]). + - name: gc_g1_young_collection_count + exp: java_lang_G1_Young_Generation_CollectionCount.tagEqual('type','GarbageCollector').sum(['cluster','service_instance_id']).increase("PT1M") + # The gc time spent in G1 Old Generation in milliseconds(JDK[9,17]). + - name: gc_g1_old_collection_time + exp: java_lang_G1_Old_Generation_CollectionTime.tagEqual('type','GarbageCollector').sum(['cluster','service_instance_id']).increase("PT1M") + # The gc time spent in G1 Young Generation in milliseconds(JDK[9,17]). + - name: gc_g1_young_collection_time + exp: java_lang_G1_Young_Generation_CollectionTime.tagEqual('type','GarbageCollector').sum(['cluster','service_instance_id']).increase("PT1M") + # The gc count of PS MarkSweep(JDK[6,8]). + - name: gc_parallel_old_collection_count + exp: java_lang_GarbageCollector_CollectionCount.tagEqual('name','PS MarkSweep').sum(['cluster','service_instance_id']).increase("PT1M") + # The gc count of PS Scavenge(JDK[6,8]). + - name: gc_parallel_young_collection_count + exp: java_lang_GarbageCollector_CollectionCount.tagEqual('name','PS Scavenge').sum(['cluster','service_instance_id']).increase("PT1M") + # The gc time spent in PS MarkSweep in milliseconds(JDK[6,8]). + - name: gc_parallel_old_collection_time + exp: java_lang_GarbageCollector_CollectionTime.tagEqual('name','PS MarkSweep').sum(['cluster','service_instance_id']).increase("PT1M") + # The gc time spent in PS Scavenge in milliseconds(JDK[6,8]). + - name: gc_parallel_young_collection_time + exp: java_lang_GarbageCollector_CollectionTime.tagEqual('name','PS Scavenge').sum(['cluster','service_instance_id']).increase("PT1M") + # Number of messages that have been sent to the broker per second. + - name: enqueue_rate + exp: org_apache_activemq_Broker_TotalEnqueueCount.sum((['cluster'])).rate("PT1M") + # Number of messages that have been acknowledged or discarded on the broker per second. + - name: dequeue_rate + exp: org_apache_activemq_Broker_TotalDequeueCount.sum(['cluster']).rate("PT1M") + # Number of messages that has been delivered to consumers per second. + - name: dispatch_rate + exp: org_apache_activemq_Broker_DispatchCount.sum(['cluster']).rate("PT1M") + # Number of messages that have been expired per second. + - name: expired_rate + exp: org_apache_activemq_Broker_ExpiredCount.sum(['cluster']).rate("PT1M") + # The average time a message was held on this cluster. + - name: average_enqueue_time + exp: org_apache_activemq_Broker_AverageEnqueueTime.avg(['cluster']) + # The max time a message was held on this cluster. + - name: max_enqueue_time + exp: org_apache_activemq_Broker_MaxEnqueueTime.max(['cluster']) diff --git a/oap-server/server-starter/src/main/resources/otel-rules/activemq/activemq-destination.yaml b/oap-server/server-starter/src/main/resources/otel-rules/activemq/activemq-destination.yaml new file mode 100644 index 000000000000..c69e6381940e --- /dev/null +++ b/oap-server/server-starter/src/main/resources/otel-rules/activemq/activemq-destination.yaml @@ -0,0 +1,79 @@ +# 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. + +# This will parse a textual representation of a duration. The formats +# accepted are based on the ISO-8601 duration format {@code PnDTnHnMn.nS} +# with days considered to be exactly 24 hours. +#

+# Examples: +#

+#    "PT20.345S" -- parses as "20.345 seconds"
+#    "PT15M"     -- parses as "15 minutes" (where a minute is 60 seconds)
+#    "PT10H"     -- parses as "10 hours" (where an hour is 3600 seconds)
+#    "P2D"       -- parses as "2 days" (where a day is 24 hours or 86400 seconds)
+#    "P2DT3H4M"  -- parses as "2 days, 3 hours and 4 minutes"
+#    "P-6H3M"    -- parses as "-6 hours and +3 minutes"
+#    "-P6H3M"    -- parses as "-6 hours and -3 minutes"
+#    "-P-6H+3M"  -- parses as "+6 hours and -3 minutes"
+# 
+filter: "{ tags -> tags.job_name == 'activemq-monitoring' }" # The OpenTelemetry job name +expSuffix: tag({tags -> tags.cluster = 'activemq::' + tags.cluster}).endpoint(['cluster'], ['destinationName'], Layer.ACTIVEMQ) +metricPrefix: meter_activemq_destination +metricsRules: + # Number of producers attached to this destination. + - name: producer_count + exp: org_apache_activemq_Broker_ProducerCount.sum(['cluster','destinationName','destinationType']) + # Number of consumers subscribed to this destination. + - name: consumer_count + exp: org_apache_activemq_Broker_ConsumerCount.sum(['cluster','destinationName','destinationType']) + # Number of consumers subscribed to the topics. + - name: topic_consumer_count + exp: org_apache_activemq_Broker_ConsumerCount.tagEqual('destinationType','Topic').sum(['cluster','destinationName']) + # The number of messages that have not been acknowledged by a consumer. + - name: queue_size + exp: org_apache_activemq_Broker_QueueSize.sum(['cluster','destinationName','destinationType']) + # Percentage of configured memory used by the destination. + - name: memory_usage + exp: org_apache_activemq_Broker_MemoryUsageByteCount.sum(['cluster','destinationName','destinationType']) + # Percentage of configured memory used by the destination. + - name: memory_percent_usage + exp: org_apache_activemq_Broker_MemoryPercentUsage.sum(['cluster','destinationName','destinationType']) + # The number of messages sent to the destination. + - name: enqueue_count + exp: org_apache_activemq_Broker_EnqueueCount.sum(['cluster','destinationName','destinationType']) + # The number of messages the destination has delivered to consumers. + - name: dequeue_count + exp: org_apache_activemq_Broker_DequeueCount.sum(['cluster','destinationName','destinationType']) + # The average time a message was held on this destination. + - name: average_enqueue_time + exp: org_apache_activemq_Broker_AverageEnqueueTime.sum(['cluster','destinationName','destinationType']) + # The max time a message was held on this destination. + - name: max_enqueue_time + exp: org_apache_activemq_Broker_MaxEnqueueTime.sum(['cluster','destinationName','destinationType']) + # Number of messages that has been delivered to consumers. + - name: dispatch_count + exp: org_apache_activemq_Broker_DispatchCount.sum(['cluster','destinationName','destinationType']) + # Number of messages that have been expired. + - name: expired_count + exp: org_apache_activemq_Broker_ExpiredCount.sum(['cluster','destinationName','destinationType']) + # Number of messages that have been dispatched to but not acknowledged by consumers. + - name: inflight_count + exp: org_apache_activemq_Broker_InFlightCount.sum(['cluster','destinationName','destinationType']) + # Average message size on this destination. + - name: average_message_size + exp: org_apache_activemq_Broker_AverageMessageSize.avg(['cluster','destinationName','destinationType']) + # Max message size on this destination. + - name: max_message_size + exp: org_apache_activemq_Broker_MaxMessageSize.max(['cluster','destinationName','destinationType']) diff --git a/oap-server/server-starter/src/main/resources/ui-initialized-templates/activemq/activemq-broker.json b/oap-server/server-starter/src/main/resources/ui-initialized-templates/activemq/activemq-broker.json new file mode 100644 index 000000000000..33e75a87272f --- /dev/null +++ b/oap-server/server-starter/src/main/resources/ui-initialized-templates/activemq/activemq-broker.json @@ -0,0 +1,355 @@ +[ + { + "id": "ActiveMQ-Broker", + "configuration": { + "children": [ + { + "x": 6, + "y": 0, + "w": 6, + "h": 9, + "i": "0", + "type": "Widget", + "expressions": [ + "meter_activemq_broker_state" + ], + "graph": { + "type": "Table", + "showTableValues": true, + "tableHeaderCol1": "", + "tableHeaderCol2": "" + }, + "widget": { + "name": "SlaveBroker", + "title": "Slave Broker", + "tips": "If slave broker then 1 else 0" + } + }, + { + "x": 0, + "y": 0, + "w": 6, + "h": 9, + "i": "1", + "type": "Widget", + "expressions": [ + "meter_activemq_broker_uptime/1000/60/60" + ], + "graph": { + "type": "Table", + "showTableValues": true, + "tableHeaderCol2": "" + }, + "metricConfig": [ + { + "unit": "day", + "label": "Uptime" + } + ], + "widget": { + "name": "BrokerUptime", + "title": "Uptime", + "tips": "Uptime of the broker in day." + } + }, + { + "x": 12, + "y": 0, + "w": 12, + "h": 9, + "i": "2", + "type": "Widget", + "expressions": [ + "meter_activemq_broker_current_connentions" + ], + "graph": { + "type": "Area", + "opacity": 0.4, + "showXAxis": true, + "showYAxis": true + }, + "metricConfig": [ + { + "label": "Connections" + } + ], + "widget": { + "name": "Connections", + "title": "Connections", + "tips": "The number of clients connected to the broker currently." + } + }, + { + "x": 12, + "y": 9, + "w": 6, + "h": 9, + "i": "3", + "type": "Widget", + "expressions": [ + "aggregate_labels(meter_activemq_broker_producer_count,sum)" + ], + "graph": { + "type": "Bar", + "showBackground": true + }, + "widget": { + "name": "ProducerCount", + "title": "Increased Producer Count", + "tips": "The number of producers currently attached to the broker." + }, + "metricConfig": [ + { + "label": "Producer" + } + ] + }, + { + "x": 18, + "y": 9, + "w": 6, + "h": 9, + "i": "4", + "type": "Widget", + "expressions": [ + "aggregate_labels(meter_activemq_broker_consumer_count,sum)" + ], + "graph": { + "type": "Bar", + "showBackground": true + }, + "widget": { + "name": "ConsumerCount", + "title": "Increased Consumer Count", + "tips": "The number of consumers consuming messages from the broker." + }, + "metricConfig": [ + { + "label": "Consumer" + } + ] + }, + { + "x": 0, + "y": 18, + "w": 12, + "h": 10, + "i": "5", + "type": "Widget", + "expressions": [ + "aggregate_labels(meter_activemq_broker_enqueue_count,sum)", + "aggregate_labels(meter_activemq_broker_dequeue_count,sum)" + ], + "graph": { + "type": "Area", + "opacity": 0.4, + "showXAxis": true, + "showYAxis": true + }, + "metricConfig": [ + { + "label": "Enqueue" + }, + { + "label": "Dequeue" + } + ], + "widget": { + "name": "EnqueueDequeueCount", + "title": "Enqueue/Dequeue Count", + "tips": "The total number of messages sent to the broker & The total number of messages the broker has delivered to consumers." + } + }, + { + "x": 0, + "y": 28, + "w": 8, + "h": 11, + "i": "6", + "type": "Widget", + "expressions": [ + "aggregate_labels(meter_activemq_broker_memory_usage,sum)/1024/1024" + ], + "graph": { + "type": "Area", + "opacity": 0.4, + "showXAxis": true, + "showYAxis": true + }, + "metricConfig": [ + { + "label": "Memory Usage", + "unit": "MB" + } + ], + "widget": { + "name": "MemoryUsage", + "title": "Memory Usage(MB)", + "tips": "Memory used by undelivered messages in the broker." + } + }, + { + "x": 8, + "y": 28, + "w": 8, + "h": 11, + "i": "7", + "type": "Widget", + "expressions": [ + "aggregate_labels(meter_activemq_broker_memory_limit,sum)/1024/1024/1024", + "aggregate_labels(meter_activemq_broker_store_limit,sum)/1024/1024/1024", + "aggregate_labels(meter_activemq_broker_temp_limit,sum)/1024/1024/1024" + ], + "metricConfig": [ + { + "unit": "GB", + "label": "Memory Usage Limit" + }, + { + "label": "Store Usage Limit", + "unit": "GB" + }, + { + "unit": "GB", + "label": "Temp Usage Limit" + } + ], + "graph": { + "type": "Area", + "opacity": 0.4, + "showXAxis": true, + "showYAxis": true + }, + "widget": { + "name": "UsageLimit", + "title": "Usage Limit(GB)", + "tips": "Disk limit for messages." + } + }, + { + "x": 16, + "y": 28, + "w": 8, + "h": 11, + "i": "8", + "type": "Widget", + "expressions": [ + "aggregate_labels(meter_activemq_broker_average_message_size,avg)", + "aggregate_labels(meter_activemq_broker_max_message_size,max)" + ], + "metricConfig": [ + { + "unit": "bytes", + "label": "Average Message Size" + }, + { + "label": "Max Message Size", + "unit": "bytes" + } + ], + "graph": { + "type": "Area", + "opacity": 0.4, + "showXAxis": true, + "showYAxis": true + }, + "widget": { + "name": "MessageSize", + "title": "Message Size", + "tips": "Average/Max message size on this broker." + } + }, + { + "x": 0, + "y": 9, + "w": 6, + "h": 9, + "i": "9", + "type": "Widget", + "expressions": [ + "latest(aggregate_labels(meter_activemq_broker_current_producer_count,sum))" + ], + "graph": { + "type": "Card", + "fontSize": 24, + "textAlign": "center", + "showUnit": true + }, + "widget": { + "name": "CurrentProducerCount", + "title": "Current Producer Count", + "tips": "The number of producers currently attached to the broker." + }, + "metricConfig": [ + { + "label": "Current Producers" + } + ] + }, + { + "x": 6, + "y": 9, + "w": 6, + "h": 9, + "i": "10", + "type": "Widget", + "expressions": [ + "latest(aggregate_labels(meter_activemq_broker_current_consumer_count,sum))" + ], + "graph": { + "type": "Card", + "fontSize": 24, + "textAlign": "center", + "showUnit": true + }, + "widget": { + "name": "CurrentConsumerCount", + "title": "Current Consumer Count", + "tips": "The number of consumers consuming messages from the broker." + }, + "metricConfig": [ + { + "label": "Current Consumers" + } + ] + }, + { + "x": 12, + "y": 18, + "w": 12, + "h": 10, + "i": "11", + "type": "Widget", + "expressions": [ + "aggregate_labels(meter_activemq_broker_enqueue_rate,avg)", + "aggregate_labels(meter_activemq_broker_dequeue_rate,avg)" + ], + "graph": { + "type": "Area", + "opacity": 0.4, + "showXAxis": true, + "showYAxis": true + }, + "widget": { + "name": "EnqueueDequeueRate", + "title": "Enqueue/Dequeue Rate", + "tips": "Enqueue/Dequeue Rate per second." + }, + "metricConfig": [ + { + "label": "Enqueue" + }, + { + "label": "Dequeue" + } + ] + } + ], + "layer": "ACTIVEMQ", + "entity": "ServiceInstance", + "name": "ActiveMQ-Broker", + "id": "ActiveMQ-Broker", + "isRoot": false + } + } +] \ No newline at end of file diff --git a/oap-server/server-starter/src/main/resources/ui-initialized-templates/activemq/activemq-cluster.json b/oap-server/server-starter/src/main/resources/ui-initialized-templates/activemq/activemq-cluster.json new file mode 100644 index 000000000000..d336ffdd4125 --- /dev/null +++ b/oap-server/server-starter/src/main/resources/ui-initialized-templates/activemq/activemq-cluster.json @@ -0,0 +1,509 @@ +[ + { + "id": "ActiveMQ-Cluster", + "configuration": { + "children": [ + { + "x": 0, + "y": 0, + "w": 24, + "h": 42, + "i": "0", + "type": "Tab", + "children": [ + { + "name": "Overview", + "children": [ + { + "x": 0, + "y": 0, + "w": 12, + "h": 11, + "i": "0", + "type": "Widget", + "expressions": [ + "meter_activemq_cluster_system_load_average/10000" + ], + "graph": { + "type": "Bar", + "showBackground": true + }, + "metricConfig": [ + { + "label": "System Load Average" + } + ], + "widget": { + "name": "SystemLoadAverage", + "title": "System Load Average", + "tips": "The average system load, range:[0, 100]." + } + }, + { + "x": 12, + "y": 0, + "w": 12, + "h": 11, + "i": "1", + "type": "Widget", + "expressions": [ + "meter_activemq_cluster_thread_count" + ], + "graph": { + "type": "Area", + "opacity": 0.4, + "showXAxis": true, + "showYAxis": true + }, + "widget": { + "name": "ThreadCount", + "title": "Thread Count", + "tips": "Threads currently used by the JVM." + }, + "metricConfig": [ + { + "label": "Thread Count" + } + ] + }, + { + "x": 0, + "y": 11, + "w": 4, + "h": 9, + "i": "2", + "type": "Widget", + "expressions": [ + "latest(aggregate_labels(meter_activemq_cluster_heap_memory_usage_init,sum))/1024/1024" + ], + "graph": { + "type": "Card", + "fontSize": 24, + "textAlign": "center", + "showUnit": true + }, + "metricConfig": [ + { + "unit": "MB", + "label": "Heap Memory(INIT)" + } + ], + "widget": { + "name": "HeapMemoryInit", + "title": "Heap Memory(INIT)", + "tips": "The initial amount of heap memory available." + } + }, + { + "x": 8, + "y": 11, + "w": 4, + "h": 9, + "i": "3", + "type": "Widget", + "expressions": [ + "latest(aggregate_labels(meter_activemq_cluster_heap_memory_usage_max,sum))/1024/1024" + ], + "graph": { + "type": "Card", + "fontSize": 24, + "textAlign": "center", + "showUnit": true + }, + "metricConfig": [ + { + "unit": "MB", + "label": "Heap Memory(MAX)" + } + ], + "widget": { + "name": "HeapMemoryMax", + "title": "Heap Memory(MAX)", + "tips": "The maximum possible size of the heap memory." + } + }, + { + "x": 4, + "y": 11, + "w": 4, + "h": 9, + "i": "4", + "type": "Widget", + "expressions": [ + "latest(aggregate_labels(meter_activemq_cluster_heap_memory_usage_committed,sum))/1024/1024" + ], + "graph": { + "type": "Card", + "fontSize": 24, + "textAlign": "center", + "showUnit": true + }, + "metricConfig": [ + { + "unit": "MB", + "label": "Heap Memory(COMMITTED)" + } + ], + "widget": { + "name": "HeapMemoryCommitted", + "title": "Heap Memory(COMMITTED)", + "tips": "The memory is guaranteed to be available for the JVM to use." + } + }, + { + "x": 12, + "y": 11, + "w": 12, + "h": 9, + "i": "5", + "type": "Widget", + "expressions": [ + "meter_activemq_cluster_heap_memory_usage_used/1024/1024" + ], + "graph": { + "type": "Area", + "opacity": 0.4, + "showXAxis": true, + "showYAxis": true + }, + "metricConfig": [ + { + "unit": "MB", + "label": "Heap Memory(USED)" + } + ], + "widget": { + "name": "HeapMemoryUsed", + "title": "Heap Memory(USED)", + "tips": "The amount of JVM heap memory currently in use." + } + }, + { + "x": 0, + "y": 31, + "w": 6, + "h": 11, + "i": "8", + "type": "Widget", + "expressions": [ + "meter_activemq_cluster_enqueue_rate" + ], + "graph": { + "type": "Area", + "opacity": 0.4, + "showXAxis": true, + "showYAxis": true + }, + "widget": { + "name": "EnqueueRate", + "title": "Enqueue Count/s", + "tips": "Number of messages that have been sent to the cluster per second." + }, + "metricConfig": [ + { + "label": "Enqueue Rate" + } + ] + }, + { + "x": 6, + "y": 31, + "w": 6, + "h": 11, + "i": "9", + "type": "Widget", + "expressions": [ + "meter_activemq_cluster_dequeue_rate" + ], + "graph": { + "type": "Area", + "opacity": 0.4, + "showXAxis": true, + "showYAxis": true + }, + "widget": { + "name": "DequeueRate", + "title": "Dequeue Count/s", + "tips": "Number of messages that have been acknowledged or discarded on the cluster per second." + }, + "metricConfig": [ + { + "label": "Dequeue Rate" + } + ] + }, + { + "x": 12, + "y": 31, + "w": 6, + "h": 11, + "i": "10", + "type": "Widget", + "expressions": [ + "meter_activemq_cluster_dispatch_rate" + ], + "graph": { + "type": "Area", + "opacity": 0.4, + "showXAxis": true, + "showYAxis": true + }, + "widget": { + "name": "DispatchRate", + "title": "Dispatch Count/s", + "tips": "Number of messages that has been delivered to consumers per second." + }, + "metricConfig": [ + { + "label": "Dispatch Rate" + } + ] + }, + { + "x": 18, + "y": 31, + "w": 6, + "h": 11, + "i": "11", + "type": "Widget", + "expressions": [ + "meter_activemq_cluster_expired_rate" + ], + "graph": { + "type": "Area", + "opacity": 0.4, + "showXAxis": true, + "showYAxis": true + }, + "widget": { + "name": "ExpiredRate", + "title": "Expired Count/s", + "tips": "Number of messages that have been expired per second." + }, + "metricConfig": [ + { + "label": "Expired Rate" + } + ] + }, + { + "x": 0, + "y": 42, + "w": 12, + "h": 12, + "i": "12", + "type": "Widget", + "expressions": [ + "meter_activemq_cluster_average_enqueue_time/1000" + ], + "graph": { + "type": "Area", + "opacity": 0.4, + "showXAxis": true, + "showYAxis": true + }, + "widget": { + "name": "AverageEnqueueTime", + "title": "Average Enqueue Time(s)", + "tips": "The average time a message was held on this cluster." + }, + "metricConfig": [ + { + "label": "Max Enqueue Time", + "unit": "s" + } + ] + }, + { + "x": 6, + "y": 20, + "w": 6, + "h": 11, + "i": "13", + "type": "Widget", + "expressions": [ + "view_as_seq(meter_activemq_cluster_gc_g1_old_collection_count,meter_activemq_cluster_gc_parallel_old_collection_count)" + ], + "graph": { + "type": "Bar", + "showBackground": true + }, + "widget": { + "name": "GCOldCollectionCount", + "title": "GC Old Collection Count", + "tips": "The GC count of Old Generation." + } + }, + { + "x": 0, + "y": 20, + "w": 6, + "h": 11, + "i": "14", + "type": "Widget", + "expressions": [ + "view_as_seq(meter_activemq_cluster_gc_g1_young_collection_count,meter_activemq_cluster_gc_parallel_young_collection_count)" + ], + "graph": { + "type": "Bar", + "showBackground": true + }, + "widget": { + "name": "GCYoungCollectionCount", + "title": "GC Young Collection Count", + "tips": "The GC count of Young Generation." + } + }, + { + "x": 18, + "y": 20, + "w": 6, + "h": 11, + "i": "15", + "type": "Widget", + "expressions": [ + "view_as_seq(meter_activemq_cluster_gc_g1_old_collection_time,meter_activemq_cluster_gc_parallel_old_collection_time)" + ], + "graph": { + "type": "Area", + "opacity": 0.4, + "showXAxis": true, + "showYAxis": true + }, + "widget": { + "name": "GCOldCollectionTime", + "title": "GC Old Collection Time(ms)", + "tips": "The GC time spent in Old Generation in milliseconds." + } + }, + { + "x": 12, + "y": 20, + "w": 6, + "h": 11, + "i": "16", + "type": "Widget", + "expressions": [ + "view_as_seq(meter_activemq_cluster_gc_g1_young_collection_time,meter_activemq_cluster_gc_parallel_young_collection_time)" + ], + "graph": { + "type": "Area", + "opacity": 0.4, + "showXAxis": true, + "showYAxis": true + }, + "widget": { + "name": "GCYoungCollectionTime", + "title": "GC Young Collection Time(ms)", + "tips": "The GC time spent in Young Generation in milliseconds." + } + }, + { + "x": 12, + "y": 42, + "w": 12, + "h": 12, + "i": "17", + "type": "Widget", + "graph": { + "type": "Area", + "opacity": 0.4, + "showXAxis": true, + "showYAxis": true + }, + "expressions": [ + "meter_activemq_cluster_max_enqueue_time/1000" + ], + "metricConfig": [ + { + "label": "Max Enqueue Time", + "unit": "s" + } + ], + "widget": { + "name": "MaxEnqueueTime", + "title": "Max Enqueue Time(s)", + "tips": "The max time a message was held on this cluster." + } + } + ] + }, + { + "name": "Broker", + "children": [ + { + "x": 0, + "y": 0, + "w": 24, + "h": 30, + "i": "0", + "type": "Widget", + "graph": { + "type": "InstanceList", + "dashboardName": "ActiveMQ-Broker", + "fontSize": 12 + } + } + ] + }, + { + "name": "Destination", + "children": [ + { + "x": 0, + "y": 0, + "w": 15, + "h": 32, + "i": "0", + "type": "Widget", + "graph": { + "type": "EndpointList", + "dashboardName": "ActiveMQ-Destination", + "fontSize": 12 + }, + "metricConfig": [ + { + "label": "Enqueue" + }, + { + "label": "Dequeue" + } + ], + "widget": { + "name": "DestinationList", + "title": "Destination List" + }, + "expressions": [] + }, + { + "x": 15, + "y": 0, + "w": 9, + "h": 32, + "i": "1", + "type": "Widget", + "expressions": [ + "top_n(meter_activemq_destination_topic_consumer_count,10,des)" + ], + "graph": { + "type": "TopList", + "color": "purple" + }, + "widget": { + "title": "Top10 Topic Consumer", + "tips": "Top10 Topic Consumer" + } + } + ] + } + ] + } + ], + "layer": "ACTIVEMQ", + "entity": "Service", + "name": "ActiveMQ-Cluster", + "id": "ActiveMQ-Cluster", + "isRoot": false + } + } +] \ No newline at end of file diff --git a/oap-server/server-starter/src/main/resources/ui-initialized-templates/activemq/activemq-destination.json b/oap-server/server-starter/src/main/resources/ui-initialized-templates/activemq/activemq-destination.json new file mode 100644 index 000000000000..e309b0034910 --- /dev/null +++ b/oap-server/server-starter/src/main/resources/ui-initialized-templates/activemq/activemq-destination.json @@ -0,0 +1,226 @@ +[ + { + "id": "ActiveMQ-Destination", + "configuration": { + "children": [ + { + "x": 0, + "y": 0, + "w": 6, + "h": 11, + "i": "0", + "type": "Widget", + "expressions": [ + "meter_activemq_destination_producer_count" + ], + "graph": { + "type": "Line", + "step": false, + "smooth": false, + "showSymbol": true, + "showXAxis": true, + "showYAxis": true + }, + "widget": { + "name": "ProducerCount", + "title": "Producer Count", + "tips": "Number of producers attached to this destination." + }, + "metricConfig": [ + { + "label": "Producer" + } + ] + }, + { + "x": 6, + "y": 0, + "w": 6, + "h": 11, + "i": "1", + "type": "Widget", + "expressions": [ + "meter_activemq_destination_consumer_count" + ], + "graph": { + "type": "Line", + "step": false, + "smooth": false, + "showSymbol": true, + "showXAxis": true, + "showYAxis": true + }, + "widget": { + "name": "ConsumerCount", + "title": "Consumer Count", + "tips": "Number of consumers subscribed to this destination." + }, + "metricConfig": [ + { + "label": "Consumer" + } + ] + }, + { + "x": 0, + "y": 11, + "w": 12, + "h": 11, + "i": "3", + "type": "Widget", + "expressions": [ + "meter_activemq_destination_queue_size" + ], + "graph": { + "type": "Area", + "opacity": 0.4, + "showXAxis": true, + "showYAxis": true + }, + "metricConfig": [ + { + "label": "Queue Size" + } + ], + "widget": { + "name": "QueueSize", + "title": "Queue Size", + "tips": "The number of messages that have not been acknowledged by a consumer." + } + }, + { + "x": 12, + "y": 0, + "w": 12, + "h": 11, + "i": "4", + "type": "Widget", + "expressions": [ + "meter_activemq_destination_memory_usage/1024/1024" + ], + "graph": { + "type": "Area", + "opacity": 0.4, + "showXAxis": true, + "showYAxis": true + }, + "metricConfig": [ + { + "label": "Memory Usage", + "unit": "MB" + } + ], + "widget": { + "name": "MemoyUsage", + "title": "Memoy Usage", + "tips": "Memory used by undelivered messages in bytes." + } + }, + { + "x": 12, + "y": 11, + "w": 12, + "h": 11, + "i": "5", + "type": "Widget", + "expressions": [ + "meter_activemq_destination_enqueue_count", + "meter_activemq_destination_dequeue_count", + "meter_activemq_destination_dispatch_count", + "meter_activemq_destination_expired_count", + "meter_activemq_destination_inflight_count" + ], + "graph": { + "type": "Area", + "opacity": 0.4, + "showXAxis": true, + "showYAxis": true + }, + "widget": { + "name": "MessageCount", + "title": "Message Count", + "tips": "The count of enqueue/dequeue/dispatch/expired/inflignt messages." + }, + "metricConfig": [ + { + "label": "Enqueue" + }, + { + "label": "Dequeue" + }, + { + "label": "Dispatch" + }, + { + "label": "Expired" + }, + { + "label": "Inflight" + } + ] + }, + { + "x": 0, + "y": 22, + "w": 12, + "h": 11, + "i": "7", + "type": "Widget", + "expressions": [ + "meter_activemq_destination_average_enqueue_time/1000" + ], + "graph": { + "type": "Area", + "opacity": 0.4, + "showXAxis": true, + "showYAxis": true + }, + "metricConfig": [ + { + "label": "Max Enqueue Time", + "unit": "s" + } + ], + "widget": { + "name": "AverageEnqueueTime", + "title": "Average Enqueue Time(s)", + "tips": "The average time a message was held on this destination." + } + }, + { + "x": 12, + "y": 22, + "w": 12, + "h": 11, + "i": "8", + "type": "Widget", + "expressions": [ + "meter_activemq_destination_max_enqueue_time/1000" + ], + "graph": { + "type": "Area", + "opacity": 0.4, + "showXAxis": true, + "showYAxis": true + }, + "metricConfig": [ + { + "unit": "s", + "label": "Max Enqueue Time" + } + ], + "widget": { + "name": "MaxEnqueueTime", + "title": "Max Enqueue Time(s)", + "tips": "The max time a message was held on this destination." + } + } + ], + "layer": "ACTIVEMQ", + "entity": "Endpoint", + "name": "ActiveMQ-Destination", + "id": "ActiveMQ-Destination", + "isRoot": false + } + } +] \ No newline at end of file diff --git a/oap-server/server-starter/src/main/resources/ui-initialized-templates/activemq/activemq-root.json b/oap-server/server-starter/src/main/resources/ui-initialized-templates/activemq/activemq-root.json new file mode 100644 index 000000000000..6783e169b96f --- /dev/null +++ b/oap-server/server-starter/src/main/resources/ui-initialized-templates/activemq/activemq-root.json @@ -0,0 +1,46 @@ +[ + { + "id": "ActiveMQ-Root", + "configuration": { + "children": [ + { + "x": 0, + "y": 3, + "w": 24, + "h": 29, + "i": "0", + "type": "Widget", + "graph": { + "type": "ServiceList", + "dashboardName": "ActiveMQ-Cluster", + "fontSize": 12, + "showXAxis": false, + "showYAxis": false, + "showGroup": true + } + }, + { + "x": 0, + "y": 0, + "w": 24, + "h": 3, + "i": "1", + "type": "Text", + "graph": { + "fontColor": "theme", + "backgroundColor": "theme", + "content": "Provide ActiveMQ monitoring through OpenTelemetry's Prometheus Receiver", + "fontSize": 14, + "textAlign": "left", + "url": "https://skywalking.apache.org/docs/main/next/en/setup/backend/backend-activemq-monitoring/" + } + } + ], + "layer": "ACTIVEMQ", + "entity": "All", + "name": "ActiveMQ-Root", + "id": "ActiveMQ-Root", + "isRoot": true + } + } +] \ No newline at end of file diff --git a/oap-server/server-starter/src/main/resources/ui-initialized-templates/menu.yaml b/oap-server/server-starter/src/main/resources/ui-initialized-templates/menu.yaml index 0fe0f4852214..36735b9c9fc9 100644 --- a/oap-server/server-starter/src/main/resources/ui-initialized-templates/menu.yaml +++ b/oap-server/server-starter/src/main/resources/ui-initialized-templates/menu.yaml @@ -218,6 +218,11 @@ menus: description: Provide RocketMQ monitoring through OpenTelemetry's Prometheus Receiver. documentLink: https://skywalking.apache.org/docs/main/next/en/setup/backend/backend-rocketmq-monitoring/ i18nKey: mq_rocketmq + - title: ActiveMQ + layer: ACTIVEMQ + description: Provide ActiveMQ monitoring through OpenTelemetry's Prometheus Receiver. + documentLink: https://skywalking.apache.org/docs/main/next/en/setup/backend/backend-activemq-monitoring/ + i18nKey: mq_activemq - title: Self Observability icon: self_observability description: Self Observability provides the observabilities for running components and servers from the SkyWalking ecosystem. diff --git a/test/e2e-v2/cases/activemq/activemq-cases.yaml b/test/e2e-v2/cases/activemq/activemq-cases.yaml new file mode 100644 index 000000000000..1ea23b5f0217 --- /dev/null +++ b/test/e2e-v2/cases/activemq/activemq-cases.yaml @@ -0,0 +1,133 @@ +# 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. + +# This file is used to show how to write configuration files and can be used to test. + +cases: + # service cases + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql service ls + expected: expected/service.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_cluster_system_load_average --service-name=activemq::activemq-cluster + expected: expected/metrics-has-value-label-serviceinstanceid.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_cluster_thread_count --service-name=activemq::activemq-cluster + expected: expected/metrics-has-value-label-serviceinstanceid.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_cluster_heap_memory_usage_init --service-name=activemq::activemq-cluster + expected: expected/metrics-has-value-label-serviceinstanceid.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_cluster_heap_memory_usage_committed --service-name=activemq::activemq-cluster + expected: expected/metrics-has-value-label-serviceinstanceid.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_cluster_heap_memory_usage_used --service-name=activemq::activemq-cluster + expected: expected/metrics-has-value-label-serviceinstanceid.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_cluster_heap_memory_usage_max --service-name=activemq::activemq-cluster + expected: expected/metrics-has-value-label-serviceinstanceid.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_cluster_gc_g1_old_collection_count --service-name=activemq::activemq-cluster + expected: expected/metrics-has-value-label-serviceinstanceid.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_cluster_gc_g1_young_collection_count --service-name=activemq::activemq-cluster + expected: expected/metrics-has-value-label-serviceinstanceid.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_cluster_gc_g1_old_collection_time --service-name=activemq::activemq-cluster + expected: expected/metrics-has-value-label-serviceinstanceid.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_cluster_gc_g1_young_collection_time --service-name=activemq::activemq-cluster + expected: expected/metrics-has-value-label-serviceinstanceid.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_cluster_enqueue_rate --service-name=activemq::activemq-cluster + expected: expected/metrics-has-value.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_cluster_dequeue_rate --service-name=activemq::activemq-cluster + expected: expected/metrics-has-value.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_cluster_dispatch_rate --service-name=activemq::activemq-cluster + expected: expected/metrics-has-value.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_cluster_expired_rate --service-name=activemq::activemq-cluster + expected: expected/metrics-has-value.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_cluster_average_enqueue_time --service-name=activemq::activemq-cluster + expected: expected/metrics-has-value.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_cluster_max_enqueue_time --service-name=activemq::activemq-cluster + expected: expected/metrics-has-value.yml + + # instance cases + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql instance ls --service-name=activemq::activemq-cluster + expected: expected/instance.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_broker_uptime --service-name=activemq::activemq-cluster --instance-name=activemq-broker + expected: expected/metrics-has-value-label-serviceinstanceid.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_broker_state --service-name=activemq::activemq-cluster --instance-name=activemq-broker + expected: expected/metrics-has-value-label-serviceinstanceid.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_broker_current_connentions --service-name=activemq::activemq-cluster --instance-name=activemq-broker + expected: expected/metrics-has-value-label-serviceinstanceid.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_broker_current_producer_count --service-name=activemq::activemq-cluster --instance-name=activemq-broker + expected: expected/metrics-has-value-label-serviceinstanceid.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_broker_current_consumer_count --service-name=activemq::activemq-cluster --instance-name=activemq-broker + expected: expected/metrics-has-value-label-serviceinstanceid.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_broker_producer_count --service-name=activemq::activemq-cluster --instance-name=activemq-broker + expected: expected/metrics-has-value-label-serviceinstanceid.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_broker_consumer_count --service-name=activemq::activemq-cluster --instance-name=activemq-broker + expected: expected/metrics-has-value-label-serviceinstanceid.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_broker_enqueue_count --service-name=activemq::activemq-cluster --instance-name=activemq-broker + expected: expected/metrics-has-value-label-serviceinstanceid.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_broker_dequeue_count --service-name=activemq::activemq-cluster --instance-name=activemq-broker + expected: expected/metrics-has-value-label-serviceinstanceid.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_broker_enqueue_rate --service-name=activemq::activemq-cluster --instance-name=activemq-broker + expected: expected/metrics-has-value-label-serviceinstanceid.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_broker_dequeue_rate --service-name=activemq::activemq-cluster --instance-name=activemq-broker + expected: expected/metrics-has-value-label-serviceinstanceid.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_broker_memory_percent_usage --service-name=activemq::activemq-cluster --instance-name=activemq-broker + expected: expected/metrics-has-value-label-serviceinstanceid.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_broker_memory_usage --service-name=activemq::activemq-cluster --instance-name=activemq-broker + expected: expected/metrics-has-value-label-serviceinstanceid.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_broker_memory_limit --service-name=activemq::activemq-cluster --instance-name=activemq-broker + expected: expected/metrics-has-value-label-serviceinstanceid.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_broker_store_percent_usage --service-name=activemq::activemq-cluster --instance-name=activemq-broker + expected: expected/metrics-has-value-label-serviceinstanceid.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_broker_store_limit --service-name=activemq::activemq-cluster --instance-name=activemq-broker + expected: expected/metrics-has-value-label-serviceinstanceid.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_broker_temp_percent_usage --service-name=activemq::activemq-cluster --instance-name=activemq-broker + expected: expected/metrics-has-value-label-serviceinstanceid.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_broker_temp_limit --service-name=activemq::activemq-cluster --instance-name=activemq-broker + expected: expected/metrics-has-value-label-serviceinstanceid.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_broker_average_message_size --service-name=activemq::activemq-cluster --instance-name=activemq-broker + expected: expected/metrics-has-value-label-serviceinstanceid.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_broker_max_message_size --service-name=activemq::activemq-cluster --instance-name=activemq-broker + expected: expected/metrics-has-value-label-serviceinstanceid.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_broker_queue_size --service-name=activemq::activemq-cluster --instance-name=activemq-broker + expected: expected/metrics-has-value-label-destinationname.yml + + # endpoint cases + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql endpoint ls --service-name=activemq::activemq-cluster + expected: expected/endpoint.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_destination_producer_count --service-name=activemq::activemq-cluster --endpoint-name=testQueue + expected: expected/metrics-has-value-label-destinationtype.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_destination_consumer_count --service-name=activemq::activemq-cluster --endpoint-name=testQueue + expected: expected/metrics-has-value-label-destinationtype.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_destination_topic_consumer_count --service-name=activemq::activemq-cluster --endpoint-name=testQueue + expected: expected/metrics-has-value.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_destination_queue_size --service-name=activemq::activemq-cluster --endpoint-name=testQueue + expected: expected/metrics-has-value-label-destinationtype.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_destination_memory_usage --service-name=activemq::activemq-cluster --endpoint-name=testQueue + expected: expected/metrics-has-value-label-destinationtype.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_destination_memory_percent_usage --service-name=activemq::activemq-cluster --endpoint-name=testQueue + expected: expected/metrics-has-value-label-destinationtype.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_destination_enqueue_count --service-name=activemq::activemq-cluster --endpoint-name=testQueue + expected: expected/metrics-has-value-label-destinationtype.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_destination_dequeue_count --service-name=activemq::activemq-cluster --endpoint-name=testQueue + expected: expected/metrics-has-value-label-destinationtype.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_destination_average_enqueue_time --service-name=activemq::activemq-cluster --endpoint-name=testQueue + expected: expected/metrics-has-value-label-destinationtype.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_destination_max_enqueue_time --service-name=activemq::activemq-cluster --endpoint-name=testQueue + expected: expected/metrics-has-value-label-destinationtype.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_destination_dispatch_count --service-name=activemq::activemq-cluster --endpoint-name=testQueue + expected: expected/metrics-has-value-label-destinationtype.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_destination_expired_count --service-name=activemq::activemq-cluster --endpoint-name=testQueue + expected: expected/metrics-has-value-label-destinationtype.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_destination_inflight_count --service-name=activemq::activemq-cluster --endpoint-name=testQueue + expected: expected/metrics-has-value-label-destinationtype.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_destination_average_message_size --service-name=activemq::activemq-cluster --endpoint-name=testQueue + expected: expected/metrics-has-value-label-destinationtype.yml + - query: swctl --display yaml --base-url=http://${oap_host}:${oap_12800}/graphql metrics exec --expression=meter_activemq_destination_max_message_size --service-name=activemq::activemq-cluster --endpoint-name=testQueue + expected: expected/metrics-has-value-label-destinationtype.yml \ No newline at end of file diff --git a/test/e2e-v2/cases/activemq/config/amq/activemq.xml b/test/e2e-v2/cases/activemq/config/amq/activemq.xml new file mode 100644 index 000000000000..744c9f6b343c --- /dev/null +++ b/test/e2e-v2/cases/activemq/config/amq/activemq.xml @@ -0,0 +1,130 @@ + + + + + + + + file:${activemq.conf}/credentials.properties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/e2e-v2/cases/activemq/config/amq/config.yaml b/test/e2e-v2/cases/activemq/config/amq/config.yaml new file mode 100644 index 000000000000..7196b72d89a4 --- /dev/null +++ b/test/e2e-v2/cases/activemq/config/amq/config.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. + +--- +startDelaySeconds: 10 +hostPort: amq:1616 +username: admin +password: activemq +ssl: false +lowercaseOutputName: false +lowercaseOutputLabelNames: false +includeObjectNames: ["org.apache.activemq:*","java.lang:type=OperatingSystem","java.lang:type=GarbageCollector,*","java.lang:type=Threading","java.lang:type=Runtime","java.lang:type=Memory","java.lang:name=*"] +excludeObjectNames: ["org.apache.activemq:type=ColumnFamily,*"] +autoExcludeObjectNameAttributes: true +excludeObjectNameAttributes: + "java.lang:type=OperatingSystem": + - "ObjectName" + "java.lang:type=Runtime": + - "ClassPath" + - "SystemProperties" +rules: +- pattern: ".*" diff --git a/test/e2e-v2/cases/activemq/docker-compose.yml b/test/e2e-v2/cases/activemq/docker-compose.yml new file mode 100644 index 000000000000..54c400c05941 --- /dev/null +++ b/test/e2e-v2/cases/activemq/docker-compose.yml @@ -0,0 +1,100 @@ +# 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: "2.1" + +services: + oap: + extends: + file: ../../script/docker-compose/base-compose.yml + service: oap + ports: + - "12800:12800" + networks: + - e2e + + amq: + image: apache/activemq-classic:6.0.1 + hostname: amq + ports: + - "61616:61616" + - "8161:8161" + expose: + - 1616 + volumes: + - ./config/amq/activemq.xml:/opt/apache-activemq/conf/activemq.xml + environment: + ACTIVEMQ_SUNJMX_START: "-Dcom.sun.management.jmxremote.port=1616 -Dcom.sun.management.jmxremote.rmi.port=1616 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false" + ACTIVEMQ_BROKER_NAME: activemq-broker + healthcheck: + test: [ "CMD-SHELL", "curl --silent --fail localhost:8161 || exit 1" ] + interval: 15s + timeout: 10s + retries: 120 + networks: + - e2e + + amqexporter: + image: bitnami/jmx-exporter:0.20.0 + hostname: amqexporter + volumes: + - ./config/amq/config.yaml:/opt/bitnami/jmx-exporter/example_configs/httpserver_sample_config.yml + expose: + - 5556 + depends_on: + - amq + networks: + - e2e + + amq-consumer-mock: + image: apache/activemq-classic:6.0.1 + hostname: amq-consumer-mock + entrypoint: bash + command: + - -c + - "/opt/apache-activemq/bin/activemq consumer --brokerUrl tcp://amq:61616 --destination queue://testQueue --messageCount 10 --parallelThreads 2 && /opt/apache-activemq/bin/activemq consumer --brokerUrl tcp://amq:61616 --destination topic://testTopic --messageCount 10 --parallelThreads 2" + depends_on: + amq: + condition: service_healthy + networks: + - e2e + + amq-producer-mock: + image: apache/activemq-classic:6.0.1 + hostname: amq-producer-mock + entrypoint: bash + command: + - -c + - "/opt/apache-activemq/bin/activemq producer --brokerUrl tcp://amq:61616 --destination queue://testQueue --messageCount 50 --persistent true --message hello && /opt/apache-activemq/bin/activemq producer --brokerUrl tcp://amq:61616 --destination topic://testTopic --messageCount 50 --persistent true --message world" + depends_on: + - amq-consumer-mock + networks: + - e2e + + otel-collector: + image: otel/opentelemetry-collector:${OTEL_COLLECTOR_VERSION} + networks: + - e2e + command: [ "--config=/etc/otel-collector-config.yaml" ] + volumes: + - ./otel-collector-config.yaml:/etc/otel-collector-config.yaml + expose: + - 55678 + depends_on: + oap: + condition: service_healthy + +networks: + e2e: \ No newline at end of file diff --git a/test/e2e-v2/cases/activemq/e2e.yaml b/test/e2e-v2/cases/activemq/e2e.yaml new file mode 100644 index 000000000000..741bbd407682 --- /dev/null +++ b/test/e2e-v2/cases/activemq/e2e.yaml @@ -0,0 +1,37 @@ +# 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. + +# This file is used to show how to write configuration files and can be used to test. + +setup: + env: compose + file: docker-compose.yml + timeout: 20m + init-system-environment: ../../script/env + steps: + - name: set PATH + command: export PATH=/tmp/skywalking-infra-e2e/bin:$PATH + - name: install yq + command: bash test/e2e-v2/script/prepare/setup-e2e-shell/install.sh yq + - name: install swctl + command: bash test/e2e-v2/script/prepare/setup-e2e-shell/install.sh swctl + +verify: + retry: + count: 60 + interval: 3s + cases: + - includes: + - ./activemq-cases.yaml \ No newline at end of file diff --git a/test/e2e-v2/cases/activemq/expected/endpoint.yml b/test/e2e-v2/cases/activemq/expected/endpoint.yml new file mode 100644 index 000000000000..3bb4fa2899ea --- /dev/null +++ b/test/e2e-v2/cases/activemq/expected/endpoint.yml @@ -0,0 +1,21 @@ +# 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 "activemq::activemq-cluster" }}.1_{{ b64enc "testQueue" }} + name: testQueue +- id: {{ b64enc "activemq::activemq-cluster" }}.1_{{ b64enc "testTopic" }} + name: testTopic +{{- end}} diff --git a/test/e2e-v2/cases/activemq/expected/instance.yml b/test/e2e-v2/cases/activemq/expected/instance.yml new file mode 100644 index 000000000000..65f5ee13a58b --- /dev/null +++ b/test/e2e-v2/cases/activemq/expected/instance.yml @@ -0,0 +1,22 @@ +# 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: {{ notEmpty .id }} + name: activemq-broker + instanceuuid: {{ notEmpty .instanceuuid }} + attributes: [] + language: UNKNOWN +{{- end }} diff --git a/test/e2e-v2/cases/activemq/expected/metrics-has-value-label-destinationname.yml b/test/e2e-v2/cases/activemq/expected/metrics-has-value-label-destinationname.yml new file mode 100644 index 000000000000..9ed22aa0efa8 --- /dev/null +++ b/test/e2e-v2/cases/activemq/expected/metrics-has-value-label-destinationname.yml @@ -0,0 +1,35 @@ +# 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. + +type: TIME_SERIES_VALUES +results: + {{- contains .results }} + - metric: + labels: + {{- contains .metric.labels }} + - key: destinationName + value: {{ .value }} + {{- end}} + values: + {{- contains .values }} + - id: {{ notEmpty .id }} + value: {{ .value }} + traceid: null + - id: {{ notEmpty .id }} + value: null + traceid: null + {{- end}} + {{- end}} +error: null diff --git a/test/e2e-v2/cases/activemq/expected/metrics-has-value-label-destinationtype.yml b/test/e2e-v2/cases/activemq/expected/metrics-has-value-label-destinationtype.yml new file mode 100644 index 000000000000..100953056e0d --- /dev/null +++ b/test/e2e-v2/cases/activemq/expected/metrics-has-value-label-destinationtype.yml @@ -0,0 +1,35 @@ +# 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. + +type: TIME_SERIES_VALUES +results: + {{- contains .results }} + - metric: + labels: + {{- contains .metric.labels }} + - key: destinationType + value: {{ .value }} + {{- end}} + values: + {{- contains .values }} + - id: {{ notEmpty .id }} + value: {{ .value }} + traceid: null + - id: {{ notEmpty .id }} + value: null + traceid: null + {{- end}} + {{- end}} +error: null diff --git a/test/e2e-v2/cases/activemq/expected/metrics-has-value-label-serviceinstanceid.yml b/test/e2e-v2/cases/activemq/expected/metrics-has-value-label-serviceinstanceid.yml new file mode 100644 index 000000000000..3d71dad534ca --- /dev/null +++ b/test/e2e-v2/cases/activemq/expected/metrics-has-value-label-serviceinstanceid.yml @@ -0,0 +1,35 @@ +# 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. + +type: TIME_SERIES_VALUES +results: + {{- contains .results }} + - metric: + labels: + {{- contains .metric.labels }} + - key: service_instance_id + value: {{ .value }} + {{- end}} + values: + {{- contains .values }} + - id: {{ notEmpty .id }} + value: {{ .value }} + traceid: null + - id: {{ notEmpty .id }} + value: null + traceid: null + {{- end}} + {{- end}} +error: null diff --git a/test/e2e-v2/cases/activemq/expected/metrics-has-value.yml b/test/e2e-v2/cases/activemq/expected/metrics-has-value.yml new file mode 100644 index 000000000000..c4bbbafa3bee --- /dev/null +++ b/test/e2e-v2/cases/activemq/expected/metrics-has-value.yml @@ -0,0 +1,31 @@ +# 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. + +type: TIME_SERIES_VALUES +results: + {{- contains .results }} + - metric: + labels: [] + values: + {{- contains .values }} + - id: {{ notEmpty .id }} + value: {{ .value }} + traceid: null + - id: {{ notEmpty .id }} + value: null + traceid: null + {{- end}} + {{- end}} +error: null \ No newline at end of file diff --git a/test/e2e-v2/cases/activemq/expected/service.yml b/test/e2e-v2/cases/activemq/expected/service.yml new file mode 100644 index 000000000000..4264a842025e --- /dev/null +++ b/test/e2e-v2/cases/activemq/expected/service.yml @@ -0,0 +1,24 @@ +# 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 "activemq::activemq-cluster" }}.1 + name: activemq::activemq-cluster + group: activemq + shortname: activemq-cluster + layers: + - ACTIVEMQ + normal: true +{{- end }} \ No newline at end of file diff --git a/test/e2e-v2/cases/activemq/otel-collector-config.yaml b/test/e2e-v2/cases/activemq/otel-collector-config.yaml new file mode 100644 index 000000000000..4e42084b9ecb --- /dev/null +++ b/test/e2e-v2/cases/activemq/otel-collector-config.yaml @@ -0,0 +1,43 @@ +# 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. + +receivers: + prometheus: + config: + scrape_configs: + - job_name: "activemq-monitoring" + scrape_interval: 30s + static_configs: + - targets: ['amqexporter:5556'] + labels: + cluster: activemq-cluster + +exporters: + otlp: + endpoint: oap:11800 + tls: + insecure: true + +processors: + batch: +service: + pipelines: + metrics: + receivers: + - prometheus + processors: + - batch + exporters: + - otlp \ No newline at end of file