2.6.1 • Published 1 day ago

@mashroom/mashroom-monitoring-prometheus-exporter v2.6.1

Weekly downloads
7
License
MIT
Repository
github
Last release
1 day ago

Mashroom Monitoring Prometheus Exporter

Plugin for Mashroom Server, a Microfrontend Integration Platform.

This plugin exports the following metrics to the Prometheus monitoring system:

  • The standard metrics like CPU and memory usage described here
  • Additional V8 GC metrics (if the module prometheus-gc-stats is present)
  • Loaded plugins with status
  • HTTP request durations and response codes
  • Mashroom plugin metrics like session count, http proxy stats, memory cache stats, MongoDB/Redis connection stats, ...

Usage

If node_modules/@mashroom is configured as plugin path just add @mashroom/mashroom-monitoring-prometheus-exporter as dependency.

You can change the default configuration in your Mashroom config file like this:

{
  "plugins": {
        "Mashroom Monitoring Prometheus Exporter Webapp": {
            "path": "/myMetricsPath"
        }
    }
}
  • path: The path where the metrics will be exported (Default: /metrics)

Example Queries

The examples assume the Prometheus job to scrape the metrics adds the label service:Mashroom

Request rate:

sum(rate(mashroom_http_requests_total{service="Mashroom"}[5m]))

Requests with HTTP 500 response rate:

sum(rate(mashroom_http_requests_total{status="500", service="Mashroom"}[5m]))

95% of requests served within seconds:

histogram_quantile(0.95, sum(rate(mashroom_http_request_duration_seconds_bucket{service="Mashroom"}[5m])) by (le)) * 1000

Heap total in MB:

nodejs_heap_size_total_bytes{service="Mashroom"} / 1024 / 1024

Heap used in MB:

nodejs_heap_size_used_bytes{service="Mashroom"} / 1024 / 1024

CPU usage total in %:

avg(irate(process_cpu_seconds_total{service="Mashroom"}[5m])) * 100

GC pauses 95% quantile

histogram_quantile(0.95, sum(rate(nodejs_gc_duration_seconds_bucket[5m])) by (le))

User sessions:

mashroom_sessions_total{service="Mashroom"}

Active HTTP proxy connections (e.g. Portal App REST calls):

mashroom_http_proxy_http_pool_connections_active_total{service="Mashroom"}
mashroom_http_proxy_https_pool_connections_active_total{service="Mashroom"}
mashroom_http_proxy_ws_connections_active_total{service="Mashroom"}

Idle HTTP proxy connections:

mashroom_http_proxy_http_pool_connections_idle_total{service="Mashroom"}
mashroom_http_proxy_https_pool_connections_idle_total{service="Mashroom"}

Plugins total:

mashroom_plugins_total{service="Mashroom"}

Plugins loaded:

mashroom_plugins_loaded_total{service="Mashroom"}

Plugins in error state:

mashroom_plugins_error_total{service="Mashroom"}

Remote Portal App endpoints total:

mashroom_remote_app_endpoints_total{service="Mashroom"}

Remote Portal App endpoints in error state:

mashroom_remote_app_endpoints_error_total{service="Mashroom"}

Kubernetes remote Portal App services total:

mashroom_remote_app_k8s_services_total{service="Mashroom"}

Kubernetes remote Portal App services in error state:

mashroom_remote_app_k8s_services_error_total{service="Mashroom"}

Memory cache hit ratio:

mashroom_memory_cache_hit_ratio{service="Mashroom"}

Redis session store provider connected:

mashroom_sessions_redis_nodes_connected{service="Mashroom"}

Redis memory cache provider connected:

mashroom_memory_cache_redis_nodes_connected{service="Mashroom"}

MongoDB storage provider connected:

mashroom_storage_mongodb_connected{service="Mashroom"}

MQTT messaging system connected:

mashroom_messaging_mqtt_connected{service="Mashroom"}

Kubernetes Hints

On Kubernetes the metrics are scraped separately for each container. So, you have to do the aggregation in the query.

For example, the overall request rate would still be:

sum(rate(mashroom_http_requests_total{namespace="my-namespace"}[5m]))

But the request rate per pod:

sum by (kubernetes_pod_name) (rate(mashroom_http_requests_total{namespace="my-namespace"}[5m]))

Or the Session count per pod:

mashroom_sessions_total{namespace="my-namespace"} by (kubernetes_pod_name)

In the last two examples you typically would use {{kubernetes_pod_name}} in the legend.

Demo Grafana Dashboard

You can find a demo Grafana Dashboard here: https://github.com/nonblocking/mashroom/tree/master/packages/plugin-packages/mashroom-monitoring-prometheus-exporter/test/grafana-test/grafana/provisioning/dashboards/Mashroom%20Dashboard.json

2.6.1

1 day ago

2.6.0

1 month ago

2.5.4

4 months ago

2.5.3

4 months ago

2.5.2

4 months ago

2.5.1

4 months ago

2.5.0

4 months ago

2.4.3

10 months ago

2.4.5

6 months ago

2.4.4

8 months ago

2.4.1

11 months ago

2.4.0

11 months ago

2.4.2

11 months ago

2.3.0

1 year ago

2.3.2

1 year ago

2.3.1

1 year ago

2.2.3

1 year ago

2.2.2

1 year ago

2.2.1

2 years ago

2.2.0

2 years ago

2.1.2

2 years ago

2.1.1

2 years ago

2.1.3

2 years ago

2.1.0

2 years ago

2.0.3

2 years ago

2.0.5

2 years ago

2.0.4

2 years ago

2.0.7

2 years ago

2.0.6

2 years ago

2.0.2

2 years ago

2.0.0-alpha.4

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

2.0.0-alpha.3

2 years ago

2.0.0-alpha.0

2 years ago

2.0.0-alpha.1

2 years ago

2.0.0-alpha.2

2 years ago

1.9.4

2 years ago

1.9.3

2 years ago

1.9.1

3 years ago

1.9.2

2 years ago

1.9.0

3 years ago

1.8.3

3 years ago

1.8.2

3 years ago

1.8.1

3 years ago

1.8.0

3 years ago

1.7.10

3 years ago

1.7.9

3 years ago

1.7.8

3 years ago

1.7.7

3 years ago

1.7.6

3 years ago

1.7.5

3 years ago

1.7.4

3 years ago

1.7.3

3 years ago

1.7.2

3 years ago

1.7.1

3 years ago

1.7.0

3 years ago

1.6.4

3 years ago

1.6.3

3 years ago

1.6.2

3 years ago

1.6.1

3 years ago

1.6.0

4 years ago

1.5.4

4 years ago

1.5.3

4 years ago

1.5.2

4 years ago

1.5.1

4 years ago

1.5.0

4 years ago