You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -94,15 +94,54 @@ For database connectivity, create a Code Engine service binding between your pro
94
94
-`GET /outbound/status/{code}` - Request specific HTTP status code
95
95
96
96
Management endpoints (port 2112):
97
-
-`GET /prometheus` - Prometheus metrics endpoint
98
-
-`GET /metrics` - Alternative metrics endpoint
97
+
-`GET /metrics` - Prometheus metrics endpoint (Prometheus text format)
99
98
-`GET /health` - Health check endpoint
100
99
101
100
All outbound endpoints include simulated compute-intensive data processing (0-3s duration, 40-80% CPU intensity).
102
101
103
102
## Metrics
104
103
105
-
The application exposes Prometheus metrics at `/prometheus` (port 2112). All metric names are prefixed with a configurable value set via the `METRICS_NAME_PREFIX` environment variable (default: `mymetrics_`).
104
+
The application exposes Prometheus metrics at `/metrics` (port 2112) in Prometheus text format. All metric names are prefixed with a configurable value set via the `METRICS_NAME_PREFIX` environment variable (default: `mymetrics_`).
105
+
106
+
### Filtering Metrics
107
+
108
+
By default, Spring Boot exports many JVM, system, and application metrics. You can control which metrics are exported using the following approaches:
109
+
110
+
**Option 1: Disable entire metric categories**
111
+
112
+
Set these properties to `false` to exclude entire categories of metrics:
113
+
114
+
```properties
115
+
management.metrics.enable.jvm=false # Disable all JVM metrics
116
+
management.metrics.enable.process=false # Disable process metrics
117
+
management.metrics.enable.system=false # Disable system metrics
To export only your custom metrics (those with the `mymetrics_` prefix), disable all default categories:
128
+
129
+
```bash
130
+
ibmcloud ce application update \
131
+
--name metrics-example-app-java \
132
+
--env management.metrics.enable.jvm=false \
133
+
--env management.metrics.enable.process=false \
134
+
--env management.metrics.enable.system=false \
135
+
--env management.metrics.enable.tomcat=false \
136
+
--env management.metrics.enable.logback=false \
137
+
--env management.metrics.enable.executor=false \
138
+
--env management.metrics.enable.disk=false \
139
+
--env management.metrics.enable.application=false
140
+
```
141
+
142
+
**Option 3: Use a MeterFilter for fine-grained control**
143
+
144
+
For more advanced filtering, you can create a custom `MeterFilter` bean in your configuration. See the [Micrometer documentation](https://micrometer.io/docs/concepts#_meter_filters){: external} for details.
106
145
107
146
**Request Metrics**
108
147
-`mymetrics_requests_total`: Total requests by method and path
0 commit comments