MCPcopy Create free account
hub / github.com/github/gh-aw / mergeOTLPStringMaps

Function mergeOTLPStringMaps

pkg/workflow/observability_otlp.go:477–486  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

475// values in override when the same key is present in both. Returns nil when both
476// inputs are empty.
477func 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:

Callers 2

TestMergeOTLPStringMapsFunction · 0.85

Calls 1

safeAllocationCapacityFunction · 0.85

Tested by 1

TestMergeOTLPStringMapsFunction · 0.68