Skip to content

[cloudflarereceiver] Allow receiving all log attributes without manually specifying fields #37720

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

Closed
petern48 opened this issue Feb 5, 2025 · 1 comment · Fixed by #37721
Closed
Labels
enhancement New feature or request needs triage New item requiring triage receiver/cloudflare

Comments

@petern48
Copy link
Contributor

petern48 commented Feb 5, 2025

Component(s)

receiver/cloudflare

Is your feature request related to a problem? Please describe.

Currently, if we want to receive attributes from cloudflare logpush. We need to specify the attributes manually in the config file. Cloudflare logpush already gives us the option to specify which attributes are sent. Therefore, it's often unnecessary to manually specify (again) which attributes to receive because we simply want to ingest everything that is sent.

receivers:
  cloudflare:
    logs:
      tls:
        key_file: some_key_file
        cert_file: some_cert_file
      endpoint: 0.0.0.0:12345
      secret: 1234567890abcdef1234567890abcdef
      timestamp_field: EdgeStartTimestamp
      attributes:
        ClientIP: http_request.client_ip
        ClientRequestURI: http_request.uri

^ src

Describe the solution you'd like

I'm proposing a new convention where if the attributes field is empty, then it indicates we want to ingest everything that is sent. This helps users avoid having to modify which fields they want in two places. Happy to submit a PR myself.

receivers:
  cloudflare:
    logs:
      tls:
        key_file: some_key_file
        cert_file: some_cert_file
      endpoint: 0.0.0.0:12345
      secret: 1234567890abcdef1234567890abcdef
      timestamp_field: EdgeStartTimestamp
      attributes:
          # empty. no attributes specified -> receive all attributes that are sent

Describe alternatives you've considered

No response

Additional context

No response

@petern48 petern48 added enhancement New feature or request needs triage New item requiring triage labels Feb 5, 2025
Copy link
Contributor

github-actions bot commented Feb 5, 2025

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

songy23 pushed a commit that referenced this issue Mar 3, 2025
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description 
I'm proposing a new convention where if the attributes field is empty,
then it indicates we want to ingest everything that is sent. This helps
users avoid having to modify which fields they want in two places. Happy
to submit a PR myself. Please check out the linked issue and let me know
if you approve or want any changes. Then I will finish implementing
whatever else is necessary (e.g docs, tests).

<!-- Issue number (e.g. #1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes #37720

<!--Describe what testing was performed and which tests were added.-->
#### Testing
I added a `TestEmptyAttributes()` test to verify the behavior in
`logs_test.go`

<!--Describe the documentation added.-->
#### Documentation
I documented the new behavior in the `README.md` and added a separate
config example of how it can be used

<!--Please delete paragraphs that you did not use before submitting.-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs triage New item requiring triage receiver/cloudflare
Projects
None yet
1 participant