Skip to content

Conversation

@AnuragEkkati
Copy link
Contributor

@AnuragEkkati AnuragEkkati commented Jan 9, 2026

Summary

This PR Adds a "content_type" configuration option to the "gcp_cloud_storage" sink to allow overriding the MIME type set on uploaded GCS objects (e.g. text/plain; charset=utf-8). When not specified, the sink continues to use the encoder-derived content type which is the existing behavior.

Vector configuration

data_dir: /tmp/vector-data

sources:
  in:
    type: stdin

sinks:
  gcs:
    type: gcp_cloud_storage
    inputs: [in]
    bucket: ${GCS_BUCKET}
    key_prefix: "vector/test/"
    content_type: "text/plain; charset=utf-8"

    encoding:
      codec: text
      only_fields: ["message"]

    batch:
      max_bytes: 1000000
      timeout_secs: 2

    compression: none

How did you test this PR?

Ran unit tests:

  • cargo test gcs_content_type_ (covers default/custom/invalid cases)

Manual verification:

Ran Vector locally and confirmed newly created objects in GCS had:

  • Content-Type: text/plain; charset=utf-8 when content_type is set
  • Content-Type: text/plain when content_type is not set

Change Type

  • Bug fix
  • New feature
  • Non-functional (chore, refactoring, docs)
  • Performance

Is this a breaking change?

  • Yes
  • No

Does this PR include user facing changes?

  • Yes. Please add a changelog fragment based on our guidelines.
  • No. A maintainer will apply the no-changelog label to this PR.

AI Assistance

Cursor AI : GPT-5 to check if any corner cases exists. Make sure my style is not out of order with existing style

References

@AnuragEkkati AnuragEkkati requested review from a team as code owners January 9, 2026 19:43
@github-actions github-actions bot added domain: sinks Anything related to the Vector's sinks domain: external docs Anything related to Vector's external, public documentation labels Jan 9, 2026
@github-actions
Copy link

github-actions bot commented Jan 9, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@AnuragEkkati
Copy link
Contributor Author

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

Copy link
Contributor

@thomasqueirozb thomasqueirozb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@thomasqueirozb thomasqueirozb added this pull request to the merge queue Jan 15, 2026
Merged via the queue into vectordotdev:master with commit b8a8d7a Jan 15, 2026
50 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jan 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

domain: external docs Anything related to Vector's external, public documentation domain: sinks Anything related to the Vector's sinks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Add content_type option to gcp_cloud_storage sink

3 participants