<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
Our check for determining whether a map key can be encoded as a string
is too restrictive and doesn't into account types which are essentially
aliases for the string type and don't implement `UnmarshalText`.
I encountered this while trying to call
`(confmap.Conf).Marshal(*otelcol.Config)` when the config includes a
Prometheus receiver, which includes the [LabelName
type](https://github.com/prometheus/common/blob/main/model/labels.go#L98)
that does not implement an unmarshaling method. We can't guarantee that
all types will implement this, and [Go's print formatters
check](https://github.com/golang/go/blob/master/src/fmt/print.go#L803)
whether `(reflect.Value).Kind()` equals `reflect.String`, so I think
this will be an overall more robust approach.
<!--Describe what testing was performed and which tests were added.-->
#### Testing
I added two test cases to demonstrate when we will hit this case.
---------
Co-authored-by: Pablo Baeyens <pbaeyens31+github@gmail.com>
**Description:**
Update mapstructure to use a maintained fork,
github.com/go-viper/mapstructure/v2.
See https://github.com/mitchellh/mapstructure/issues/349 for context
**Link to tracking Issue:**
#9161
Creating this as WIP to see if all tests pass.
* [chore] use license shortform
To remain consistent w/ contrib repo, see https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/22052
Signed-off-by: Alex Boten <aboten@lightstep.com>
* make goporto
Signed-off-by: Alex Boten <aboten@lightstep.com>
---------
Signed-off-by: Alex Boten <aboten@lightstep.com>
Cleaning up the license files, and updating `checklicense` to verify the contents of the license as per the `opentelemetry-go-build-tools` repo.
---------
Signed-off-by: Alex Boten <aboten@lightstep.com>