Skip to content

Commit 2a170b9

Browse files
authored
Merge pull request #180 from dvelasquez/changeset-release/main
[ci] release
2 parents e5b5346 + 081d6f4 commit 2a170b9

File tree

4 files changed

+30
-311
lines changed

4 files changed

+30
-311
lines changed

.changeset/configurable-histogram-buckets.md

Lines changed: 0 additions & 21 deletions
This file was deleted.

packages/astro-prometheus-node-integration/CHANGELOG.md

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
11
# astro-prometheus-node-integration
22

3+
## 1.3.0
4+
5+
### Minor Changes
6+
7+
- [#179](https://github.com/dvelasquez/astro-prometheus-integration/pull/179) [`a3e2896`](https://github.com/dvelasquez/astro-prometheus-integration/commit/a3e28963a54fe20e97a880144bc9566c8be92f21) Thanks [@dvelasquez](https://github.com/dvelasquez)! - Add configurable histogram buckets for inbound and outbound metrics
8+
9+
Users can now customize histogram bucket boundaries for better performance and query optimization. The new `histogramBuckets` configuration option allows separate bucket configuration for inbound (`http_request_duration_seconds`, `http_server_duration_seconds`) and outbound (`http_response_duration_seconds`) metrics.
10+
11+
When not configured, the integration uses prom-client's default buckets `[0.005, 0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1, 2.5, 5, 10]` seconds.
12+
13+
**Example:**
14+
15+
```js
16+
prometheusNodeIntegration({
17+
histogramBuckets: {
18+
inbound: [0.05, 0.1, 0.25, 0.5, 1, 2.5, 5, 10],
19+
outbound: [0.1, 0.5, 1, 2, 5, 10, 20, 50],
20+
},
21+
});
22+
```
23+
24+
This change removes the hardcoded buckets from outbound metrics and makes all histogram buckets configurable, allowing users to optimize for their application's typical latency ranges.
25+
326
## 1.2.1
427

528
### Patch Changes
@@ -25,7 +48,6 @@
2548
This release introduces an experimental feature that allows users to choose between two different methods for measuring Time To Last Byte (TTLB) in streaming responses:
2649

2750
## ✨ New Features
28-
2951
- **Experimental flag**: `experimental.useOptimizedTTLBMeasurement` in integration config
3052
- **Two TTLB measurement methods**:
3153
- **Legacy (default)**: Stream wrapping for maximum accuracy but higher CPU usage
@@ -49,18 +71,15 @@
4971
| **Optimized** | Millisecond | Minimal | Minimal | High-concurrency apps |
5072

5173
## 🎯 Use Cases
52-
5374
- **Set to `true`**: High-concurrency applications, microservices, resource-constrained environments
5475
- **Set to `false`**: When maximum timing accuracy is critical
5576

5677
## ⚠️ Important Notes
57-
5878
- **Experimental feature**: May change in future releases
5979
- **Backward compatible**: Defaults to legacy method
6080
- **Production ready**: Both methods thoroughly tested
6181

6282
## 🔍 Technical Improvements
63-
6483
- Extracted TTLB measurement logic to `timing-utils.ts`
6584
- Added robust path fallback logic for undefined routePattern
6685
- Fixed operator precedence issues with `??` and `||`
@@ -79,21 +98,18 @@
7998
This is a **major breaking change** that optimizes the creation of metrics to avoid performance problems. The current implementation was calling expensive operations on every HTTP request, causing significant performance bottlenecks.
8099

81100
### ⚠️ Breaking Changes
82-
83101
- **Replaced `findMetrics()` function** with `initializeMetricsCache()` function
84102
- **Changed middleware initialization pattern** - metrics are now cached per registry
85103
- **Updated `createPrometheusMiddleware` function** signature and behavior
86104
- **Modified `onRequest` middleware** to use cached metrics instead of computing on each request
87105

88106
## 🔧 Performance Improvements
89-
90107
- **94.8% faster request processing** in high-traffic scenarios
91108
- **Constant performance** regardless of request volume
92109
- **Reduced resource usage** and lower response times
93110
- **Eliminated per-request metric computation** overhead
94111

95112
## 🧪 New Features
96-
97113
- **Comprehensive E2E testing suite** with Playwright
98114
- **Automated CI/CD pipeline** with linting, building, and testing
99115
- **Cross-browser testing** support
@@ -115,7 +131,6 @@
115131
```
116132

117133
## 🎉 Benefits
118-
119134
1. **Immediate Performance Gains** - Significant improvement in request processing
120135
2. **Scalability** - Performance remains constant under high load
121136
3. **Reliability** - Comprehensive E2E testing ensures functionality
@@ -140,7 +155,6 @@
140155
### Patch Changes
141156

142157
- [#22](https://github.com/dvelasquez/astro-prometheus-integration/pull/22) [`a088f4d`](https://github.com/dvelasquez/astro-prometheus-integration/commit/a088f4dba80bdd34f0055f027840f7b8cbae0e56) Thanks [@dvelasquez](https://github.com/dvelasquez)! - Fix Prometheus metrics not recording 500 server errors
143-
144158
- The middleware now properly records metrics for requests that result in unhandled exceptions (HTTP 500 errors).
145159
- Added a try/catch around the request handler to ensure that error responses increment the appropriate counters and histograms.
146160
- Improved the streaming response handler to also record 500 errors if a streaming failure occurs.
@@ -177,7 +191,6 @@
177191
### Minor Changes
178192

179193
- [`55fc2aa`](https://github.com/dvelasquez/astro-prometheus-integration/commit/55fc2aabe871363258040f1c469e37df8a2f1897) - Added standalone metrics server option that allows running the Prometheus metrics endpoint on a separate server instance. This feature enables better separation of concerns and more flexible deployment options.
180-
181194
- Added standalone metrics server configuration option
182195
- Added integration tests for standalone metrics functionality
183196
- Added default metrics test coverage
@@ -188,7 +201,6 @@
188201
### Patch Changes
189202

190203
- [`d54c8d9`](https://github.com/dvelasquez/astro-prometheus-integration/commit/d54c8d9309bf4a8a33569be2e34672465a75f081) - This release includes several improvements to the codebase:
191-
192204
- Refactored middleware to accept a provided register for better testability
193205
- Added unit tests for the middleware and metrics initialization
194206
- Updated Biome configuration for better developer experience
@@ -200,7 +212,6 @@
200212
### Minor Changes
201213

202214
- [`aa29376`](https://github.com/dvelasquez/astro-prometheus-integration/commit/aa29376ec1448b9a526664c784e4142480be6ea1) - feat: Add Prometheus metrics integration
203-
204215
- Added prom-client as a dependency for metrics collection
205216
- Implemented middleware for tracking HTTP request metrics
206217
- Added /metrics endpoint for Prometheus scraping

packages/astro-prometheus-node-integration/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "astro-prometheus-node-integration",
3-
"version": "1.2.1",
3+
"version": "1.3.0",
44
"description": "A prometheus integration for Astro.",
55
"author": {
66
"email": "danilo.velasquez@gmail.com",

0 commit comments

Comments
 (0)