prauga-flexdoc 0.4.6 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +22 -0
- data/assets/flexdoc.standalone.js +43 -43
- data/lib/prauga/flexdoc/host_execution.rb +80 -25
- data/lib/prauga/flexdoc/host_execution_observability.rb +211 -0
- data/lib/prauga/flexdoc/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2cfa79303d5ae57884ca1c3fc8157eecf7852a764c04edeece1f72302cb9f881
|
|
4
|
+
data.tar.gz: e2946cba95ac973864b0f81e8b0e9a46165fa1685b2bff3b1bfa7e3b07e8bda3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fe41dcf5a51516ac2993bd1ef08e6c698d9f9998c53c856975023c0a2000a017fa0cdbb94417eb415f5035f1b7b86dd16d7eaf279d0a7db81ec504607250db66
|
|
7
|
+
data.tar.gz: 164d984ad22590f7dafd522888de0ab3d93d46a533f355dbb2ae602383137153fe674767d7f651f760478429666eea833beebf54b5e57b9f281d3dd462642754
|
data/README.md
CHANGED
|
@@ -53,6 +53,28 @@ This first native slice supports the canonical JSON and multipart envelopes, Bas
|
|
|
53
53
|
|
|
54
54
|
The Ruby executor blocks link-local/cloud-metadata targets and validates DNS results before connecting. It then pins `Net::HTTP` to one of the validated addresses with `ipaddr=` while retaining the original hostname for the HTTP `Host` header and TLS SNI/certificate verification. Environment proxy routing is disabled for native execution, so the validated destination cannot be bypassed through `http_proxy`/`HTTP_PROXY`. Private-network relaxation is not part of this slice.
|
|
55
55
|
|
|
56
|
+
### Execution evidence
|
|
57
|
+
|
|
58
|
+
An executor that reports nothing leaves an operator guessing whether a failing Try It is a policy rejection, a slow upstream or traffic that never carried an execute marker. Pass a metric sink to emit the same metric names, labels and reason vocabulary as the Node, Python, Go and Rust hosts, so one collector reads a mixed fleet:
|
|
59
|
+
|
|
60
|
+
```ruby
|
|
61
|
+
observation = Prauga::FlexDoc::HostExecutionObservation.new
|
|
62
|
+
|
|
63
|
+
executor = Prauga::FlexDoc::HostExecution.new(
|
|
64
|
+
allowed_origins: ["https://api.example.internal"],
|
|
65
|
+
metric_sink: observation.sink
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
# Whenever an operator asks for evidence:
|
|
69
|
+
report = Prauga::FlexDoc.host_execution_observation_report(observation)
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
The sink receives `HostExecutionMetric` values carrying a name, kind, value and labels, and nothing else: no URL, header, body or credential reaches it. Bridge it to Prometheus or OpenTelemetry where such a stack exists; where none does, `HostExecutionObservation` folds the same updates into a mutex-guarded aggregate safe to share across threaded or forked-with-threads servers, and `host_execution_observation_report` produces the shared `flexdoc.host-execution.observation/1` document every other runtime also emits. Under a forking server each worker keeps its own window, so treat the export as per-process evidence.
|
|
73
|
+
|
|
74
|
+
Every non-successful execution carries one of the stable categories in `HostExecutionObservability::HOST_EXECUTION_REASONS`, which is why rejections and upstream failures are separable at all — the human-readable messages interpolate origins and field names, so they are unbounded and unusable as a metric label. Requests arriving without `X-FlexDoc-Execute` are counted by `flexdoc_execute_unmarked_total` and deliberately move no lifecycle metric, since they produced no validated envelope.
|
|
75
|
+
|
|
76
|
+
The report declares `browser-direct-transport-mix` in its gaps: a browser-direct execution never reaches this process, so the transport mix cannot be derived here. See [host-execution observability](../../docs/host-execution-observability.md) for the full metric contract and the browser half of a review. Metric delivery is best effort: a sink that raises cannot fail an execution.
|
|
77
|
+
|
|
56
78
|
## Rails
|
|
57
79
|
|
|
58
80
|
In `config/routes.rb`:
|