mergeOTLPStringMaps merges two string maps; values in base take precedence over values in override when the same key is present in both. Returns nil when both inputs are empty.
(base, override map[string]string)
| 475 | // values in override when the same key is present in both. Returns nil when both |
| 476 | // inputs are empty. |
| 477 | func mergeOTLPStringMaps(base, override map[string]string) map[string]string { |
| 478 | if len(base) == 0 && len(override) == 0 { |
| 479 | return nil |
| 480 | } |
| 481 | merged := make(map[string]string, safeAllocationCapacity(len(base), len(override))) |
| 482 | maps.Copy(merged, override) |
| 483 | // base takes precedence |
| 484 | maps.Copy(merged, base) |
| 485 | return merged |
| 486 | } |
| 487 | |
| 488 | // collectAllOTLPEndpoints reads the `observability.otlp.endpoint` field from the raw |
| 489 | // frontmatter and returns all configured endpoint entries. The `endpoint` field may be: |