-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[processor/geoip] Detect source.address from signal's attributes #34036
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
Makes sense to me, and was filed by a code owner, removing One thing to note: The README currently specifies that |
In order to let the user configure whether to look in the resource attributes or the signal's attributes (in the future could be any other source), I purpose to add the following configuration structure in the processor. geoip:
source:
from: resource_attributes The source configuration option would tell the processor whether to look for the I think being a map configuration option would ease the addition of future options for narrowed IP look ups, for example, specifying a different attribute name to override the default geoip:
source:
from: attributes
name: upstream.address |
**Description:** <Describe what has changed.> <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> - Adds a `source.from` configuration option to let the user define where the IP address will be looked for. - Adds the `attribute` source.from option. IP address can be located in the inner signal's attributes, thus adding the geographical attributes accordingly. - Decouples the signals processing in `geoip_processor_metrics.go`, `geoip_processor_traces.go` and `geoip_processor_logs.go`. Polymorphism could not be applied due to their different types and iteration mechanism, with Go `1.23` we could undo this changes in favor of a `pcommon.Map` iterator. **Link to tracking Issue:** <Issue number if applicable> #34036 **Testing:** <Describe what testing was performed and which tests were added.> - Removes the manual generation of testing signals in favor of `testdata` + golden checks. The same test cases are applied for unit and integration tests. **Documentation:** <Describe the documentation added.> README.md updated --------- Co-authored-by: Evan Bradley <11745660+evan-bradley@users.noreply.github.com> Co-authored-by: Andrzej Stencel <andrzej.stencel@elastic.co>
**Description:** <Describe what has changed.> <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> - Adds a `source.from` configuration option to let the user define where the IP address will be looked for. - Adds the `attribute` source.from option. IP address can be located in the inner signal's attributes, thus adding the geographical attributes accordingly. - Decouples the signals processing in `geoip_processor_metrics.go`, `geoip_processor_traces.go` and `geoip_processor_logs.go`. Polymorphism could not be applied due to their different types and iteration mechanism, with Go `1.23` we could undo this changes in favor of a `pcommon.Map` iterator. **Link to tracking Issue:** <Issue number if applicable> open-telemetry#34036 **Testing:** <Describe what testing was performed and which tests were added.> - Removes the manual generation of testing signals in favor of `testdata` + golden checks. The same test cases are applied for unit and integration tests. **Documentation:** <Describe the documentation added.> README.md updated --------- Co-authored-by: Evan Bradley <11745660+evan-bradley@users.noreply.github.com> Co-authored-by: Andrzej Stencel <andrzej.stencel@elastic.co>
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
Fixed in #34214 |
Component(s)
processor/geoip
Is your feature request related to a problem? Please describe.
The current GeoIP processor looks for the
source.address
field in the resource attributes of every signal. The processor should be able to detect the IP from other contexts too, for example, thesource.address
might be located in the attributes instead of the identifying resource attributes.Describe the solution you'd like
Detect the IP from the signal's attributes if not present in the resource ones, and add the corresponding geographical attributes to the same context.
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: