thomaspoignant / go-feature-flag

GO Feature Flag is a simple, complete and lightweight self-hosted feature flag solution 100% Open Source. 🎛️
https://gofeatureflag.org/
MIT License
1.49k stars 148 forks source link

(bug) Tracing: resource attribute parsing is broken (wrong data type) #2607

Closed hairyhenderson closed 3 weeks ago

hairyhenderson commented 3 weeks ago

Observed behaviour

When setting the standard OTel environment variable OTEL_RESOURCE_ATTRIBUTES to a value like key1=value1,key2=value2, the go-feature-flag relay crashes:

{
  "level": "fatal",
  "ts": 1730485805.8576112,
  "caller": "relayproxy/main.go:58",
  "msg": "error while reading configuration",
  "error": "1 error(s) decoding:\n\n* 'otel.resource.attributes' expected a map, got 'string'",
  "stacktrace": "main.main\n\t/home/runner/work/go-feature-flag/go-feature-flag/cmd/relayproxy/main.go:58\nruntime.main\n\t/opt/hostedtoolcache/go/1.22.8/x64/src/runtime/proc.go:271"
}

Either the type of OpenTelemetryConfiguration.Resource.Attributes should be changed to string to match the spec, or additional parsing will be necessary.

related: https://github.com/knadh/koanf/issues/273

Expected Behavior

The OTEL_RESOURCE_ATTRIBUTES environment variable should be supported as expected.

Steps to reproduce

No response

hairyhenderson commented 3 weeks ago

Also, it turns out that resource attributes specified in the YAML get ignored - this should also be fixed...

hairyhenderson commented 3 weeks ago

/assign-me

(I'm about to issue a PR for this)

github-actions[bot] commented 3 weeks ago

👋 Hey @hairyhenderson, this issue is already assigned to @thomaspoignant.

⚠️ It will become unassigned if it isn't closed within 10 days.

🔧 A maintainer can also add you to the list of assignees or swap you with the current assignee.