Commit d9a344f
authored
## Summary
Introduces `x-bf-dim-*` as the canonical unified header prefix for per-request observability dimensions in Bifrost. Previously, users had to use separate header families (`x-bf-prom-*`, `x-bf-maxim-*`) to propagate metadata to different backends. The new `x-bf-dim-*` prefix sends dimensions to all observability backends simultaneously — internal logs, OpenTelemetry spans, Prometheus custom labels, and Maxim tags — from a single set of headers.
## Changes
- Documented `x-bf-dim-*` as the new canonical runtime dimension prefix, replacing `x-bf-prom-*` for cross-backend observability metadata
- Added `BifrostContextKeyDimensions` (`map[string]string`) as the corresponding Go SDK context key
- Deprecated `x-bf-prom-*` headers; they remain functional for Prometheus-only backward compatibility, but `x-bf-dim-*` takes precedence when both are present for the same label
- Clarified the relationship between `x-bf-dim-*` and `x-bf-maxim-*`: shared dimensions flow to Maxim at lower priority, and explicit `x-bf-maxim-*` tags override same-named dimensions for Maxim only
- Added a dedicated "Unified dimensions" section in `request-options.mdx` with cURL and Go SDK examples
- Added a "Shared observability dimensions" section in the Maxim observability doc explaining forwarding behavior and priority rules
## Type of change
- [ ] Bug fix
- [ ] Feature
- [ ] Refactor
- [x] Documentation
- [ ] Chore/CI
## Affected areas
- [ ] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [ ] UI (React)
- [x] Docs
## How to test
Verify the documented header behavior against a running Bifrost gateway:
```sh
# Send a request with x-bf-dim-* headers and confirm dimensions appear in Prometheus metrics,
# OpenTelemetry spans, and Maxim tags
curl -X POST http://localhost:8080/v1/chat/completions \
-H "x-bf-dim-environment: production" \
-H "x-bf-dim-team: engineering" \
-d '{"model": "gpt-4o-mini", "messages": [{"role": "user", "content": "Hello!"}]}'
# Confirm legacy x-bf-prom-* headers still work
curl -X POST http://localhost:8080/v1/chat/completions \
-H "x-bf-prom-environment: production" \
-d '{"model": "gpt-4o-mini", "messages": [{"role": "user", "content": "Hello!"}]}'
# Confirm x-bf-dim-* wins when both prefixes supply the same label
curl -X POST http://localhost:8080/v1/chat/completions \
-H "x-bf-dim-environment: production" \
-H "x-bf-prom-environment: staging" \
-d '{"model": "gpt-4o-mini", "messages": [{"role": "user", "content": "Hello!"}]}'
```
## Screenshots/Recordings
N/A
## Breaking changes
- [ ] Yes
- [x] No
`x-bf-prom-*` headers continue to work. No existing behavior is removed.
## Related issues
## Security considerations
Dimensions set via `x-bf-dim-*` are propagated to all observability backends including logs, spans, and external services such as Maxim. Callers should not include secrets or PII in dimension values.
## Checklist
- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [x] I updated documentation where needed
- [ ] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable
1 parent eda9ab3 commit d9a344f
3 files changed
Lines changed: 87 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
191 | 206 | | |
192 | 207 | | |
193 | 208 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
210 | | - | |
| 210 | + | |
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
227 | | - | |
228 | | - | |
229 | | - | |
| 227 | + | |
| 228 | + | |
230 | 229 | | |
231 | 230 | | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
232 | 237 | | |
233 | 238 | | |
234 | 239 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
1065 | 1066 | | |
1066 | 1067 | | |
1067 | 1068 | | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
1068 | 1120 | | |
1069 | 1121 | | |
1070 | 1122 | | |
1071 | 1123 | | |
1072 | 1124 | | |
1073 | 1125 | | |
1074 | 1126 | | |
1075 | | - | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
1076 | 1130 | | |
1077 | 1131 | | |
1078 | 1132 | | |
| |||
1116 | 1170 | | |
1117 | 1171 | | |
1118 | 1172 | | |
| 1173 | + | |
| 1174 | + | |
1119 | 1175 | | |
1120 | 1176 | | |
1121 | 1177 | | |
| |||
0 commit comments