[receiver/github] add repository custom properties as resource attributes#40878
Conversation
adrielp
left a comment
There was a problem hiding this comment.
Overall, looks pretty good. Appreciate the addition of the tests. I left a couple nits and a suggestion around end-user documentation so that it's very clear to the end user how their custom properties are going to show up.
Not a problem at all. I updated the change log gen and added a readme update about the functionality of the custom prooperties generation as well. |
|
Let's fix the test failures. A lot of the linting/testing can be run locally with |
|
Fixed up the linting, formatting issues on top of the golden file tests as well. |
…rzko/opentelemetry-collector-contrib into feat-receiver-github-custom-properties
…utes (open-telemetry#40878) #### Description This PR enhances the GitHub receiver by adding support for custom properties from GitHub repositories as resource attributes. The implementation extracts all key-value pairs from the repository's `CustomProperties` map and adds them as resource attributes with the prefix `github.repository.custom_properties`. For example, if a repository has custom properties like `team_name: "open-telemetry"` and `environment: "development"`, they will be added as resource attributes: ``` github.repository.custom_properties.team_name = "open-telemetry" github.repository.custom_properties.environment = "development" ``` The implementation handles different value types (string, int, float, bool) appropriately and follows the OpenTelemetry convention for attribute naming, similar to how HTTP headers are handled. #### Link to tracking issue Fixes: TBD #### Testing Added unit tests for the new functionality in `model_test.go`. The tests verify: * String properties are correctly added as resource attributes * Different types (string, int, float, bool) are handled correctly * The "service_name" property is skipped (as it's handled separately) * Empty and nil maps are handled properly All tests are passing, confirming the implementation works as expected. #### Documentation TBD
Description
This PR enhances the GitHub receiver by adding support for custom properties from GitHub repositories as resource attributes. The implementation extracts all key-value pairs from the repository's
CustomPropertiesmap and adds them as resource attributes with the prefixgithub.repository.custom_properties.For example, if a repository has custom properties like
team_name: "open-telemetry"andenvironment: "development", they will be added as resource attributes:The implementation handles different value types (string, int, float, bool) appropriately and follows the OpenTelemetry convention for attribute naming, similar to how HTTP headers are handled.
Link to tracking issue
Fixes: TBD
Testing
Added unit tests for the new functionality in
model_test.go. The tests verify:All tests are passing, confirming the implementation works as expected.
Documentation
TBD