Skip to content
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

Added possibility to provide custom headers supplier and disabling requests gzip compression #739

Conversation

magdamagda
Copy link

Description
Added possibility to provide custom headers to requests. It is needed for example to provide auth headers.
Also added possibility to disable gzip compression as it is not always supported by splunk server.

Changes

  • Added two additional configurations in SplunkRumBuilder: setHeadersSupplier() and disableGzipCompression().
  • Added request interceptor: CustomHeadersRequestInterceptor, that adds headers from headers supplier to the request.
  • Configuring OkHttpSender in RumInitializer based on values in SplunkRumBuilder. If header supplier is provided, then CustomHeadersRequestInterceptor is added. Compression is enabled or disabled based on value of SplunkRumBuilder::gzipCompressionEnabled

@magdamagda magdamagda requested review from a team as code owners January 25, 2024 16:01
Copy link

CLA Assistant Lite bot:
Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


Magdalena Chrzanowska seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You can retrigger this bot by commenting recheck in this Pull Request

@breedx-splk
Copy link
Contributor

Hi @magdamagda thanks for the submission. Before we can accept a 3rd party contribution, you must first sign our CLA (see above).

Also, I'm very curious about your use case. The http sender that you have modified is the one that is used to send zipkin spans to Splunk RUM ingest (beacon endpoint). That ingest endpoint doesn't require additional headers, and we prefer to use gzip on the wire because it saves on bandwidth from user devices.

Can you help us understand the motivation behind the changes here? Thanks.

@magdamagda
Copy link
Author

Hi @magdamagda thanks for the submission. Before we can accept a 3rd party contribution, you must first sign our CLA (see above).

Also, I'm very curious about your use case. The http sender that you have modified is the one that is used to send zipkin spans to Splunk RUM ingest (beacon endpoint). That ingest endpoint doesn't require additional headers, and we prefer to use gzip on the wire because it saves on bandwidth from user devices.

Can you help us understand the motivation behind the changes here? Thanks.

Hi, thank you for quick response.
We use splunk, that is behind api gateway and it requires auth header.
I am still validating if gzip compressions can be enabled in our case.

@breedx-splk
Copy link
Contributor

@magdamagda Ok, that helps me understand, thanks for clarifying.

Because of CLA and because I'm not completely confident in how we may want to adapt this in the future with OTLP export coming soon, I'm going to propose another idea in a PR and I'll tag to you to see if it will work for you.

@breedx-splk
Copy link
Contributor

breedx-splk commented Jan 26, 2024

@magdamagda Can you please have a look at #742 and leave a comment there if you think that approach will work for you? Thanks.

@magdamagda magdamagda closed this Jan 29, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jan 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants