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
feat(loki/stages): add JSON tags to all stage config structs
Adds `json:"..."` tags to every stage configuration struct in
loki/process/stages and loki/process/metric. These tags are required to serialize stage configs to/from JSON for use in the PodLogs CRD (see #4738).
Notable serialization choices:
- `time.Duration` fields (OlderThan, MaxIdle) are tagged `json:"-"` because Go serialises them as nanosecond int64 values, which are not human-readable in Kubernetes YAML. Users can rely on the default value.
- `units.Base2Bytes` already implements TextMarshaler/TextUnmarshaler and serialises as "5MiB", so it is exposed normally.
No behaviour change — the alloy:"..." tags that drive existing parsing are untouched; json tags are purely additive.
Refs: #4738
fix(loki/stages): mark GeoIPConfig.Source as required in JSON
Remove omitempty from the Source field JSON tag so the field is never
silently dropped when serialising a PodLogs pipeline stage config.
Source is a required field (alloy:"source,attr") and omitting it in
JSON would leave a nil pointer that causes the stage to do nothing.
Refs: #4738
Signed-off-by: QuentinBisson <quentin@giantswarm.io>
0 commit comments