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

add sse config to tempo #3914

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

Conversation

KyriosGN0
Copy link
Contributor

What this PR does:

Which issue(s) this PR fixes:
Fixes #1486

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

@javiermolinar
Copy link
Contributor

@KyriosGN0
Copy link
Contributor Author

@javiermolinar according to this, it is needed

Copy link
Contributor

@javiermolinar javiermolinar left a comment

Choose a reason for hiding this comment

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

Looking good! I added a few comments. Consider adding some unit tests giving the range of options and the different errors this can have.

@@ -128,11 +130,31 @@ func internalNew(cfg *Config, confirm bool) (*readerWriter, error) {
}

func getPutObjectOptions(rw *readerWriter) minio.PutObjectOptions {
sseConfig, err := buildSSEConfig(rw.cfg)
if sseConfig == nil && err == nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

This condition is wrong, for instance, the following configuration:

 sse:
        type: blabla

Will create a PutObjectOption with SSE

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it should not, since buildSSEConfig checks if the config is incorrect, did you happen to test it and see it working (i didn't have the change to test it myself yet nor write test)

Copy link
Contributor

Choose a reason for hiding this comment

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

In that scenario, sseConfig = nil and err != nil, therefore it will go for the else branch. It doesn't matter since the sseConfig is nil so it won't affect. Maybe we could log a warning indicating that the SSE type is not valid

tempodb/backend/s3/s3.go Outdated Show resolved Hide resolved
tempodb/backend/s3/s3.go Show resolved Hide resolved
tempodb/backend/s3/s3.go Show resolved Hide resolved
StorageClass: rw.cfg.StorageClass,
UserMetadata: rw.cfg.Metadata,
ServerSideEncryption: sseConfig,
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I would expect an early fatal error if the SSE is set but wrongly configured. Nevertheless, it will fail trying to write or read the blocks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

what do you mean erroring fataly?, at the moment the buildSSEConfig will return errUnsupportedSSEType if it is configured with unsupported SSE type, and i have added an error for missing KMSKeyID, what else am i missing

Copy link
Contributor

Choose a reason for hiding this comment

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

As a user configuring SSE I would like to know if my configuration is not correctly set. Maybe a warning log?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if we've set a the config incorrectly we should error, i'll try to set up a minio locally with SSE and spin up tempo and test various configs

@knylander-grafana
Copy link
Contributor

Will this PR impact how a user configures Tempo? Should we update the config doc in this PR or open a doc issue specifically for those changes?

@javiermolinar
Copy link
Contributor

Will this PR impact how a user configures Tempo? Should we update the config doc in this PR or open a doc issue specifically for those changes?

It will add a way to configure server-side encryption for S3. It should be documented.

@knylander-grafana
Copy link
Contributor

Thank you for updating the changelog. Should we add doc for this config option? Is it a user-accessible configuration option?

@KyriosGN0
Copy link
Contributor Author

@knylander-grafana i will update the docs and ping you once i've verified it works, Thanks!

@KyriosGN0
Copy link
Contributor Author

hey @javiermolinar, im still trying to test with minio, could you (plase) try to test with S3 bucket in AWS ?

@KyriosGN0
Copy link
Contributor Author

hey @javiermolinar did you have a chance to test this ? if not i'll try to spin this myself and hopefully incur too much cost

@javiermolinar
Copy link
Contributor

hey @javiermolinar did you have a chance to test this ? if not i'll try to spin this myself and hopefully incur too much cost

Hey, I'll take a look at this on Monday

@javiermolinar
Copy link
Contributor

Thank you for your patience @KyriosGN0, this looks much better now, we need to fix the conflicts and add the new configuration to the docs and we are ready to go:

https://github.com/grafana/tempo/blob/main/docs/sources/tempo/configuration/_index.md#storage

Signed-off-by: AvivGuiser <[email protected]>
Signed-off-by: AvivGuiser <[email protected]>
Signed-off-by: AvivGuiser <[email protected]>
Signed-off-by: AvivGuiser <[email protected]>
Signed-off-by: AvivGuiser <[email protected]>
@KyriosGN0
Copy link
Contributor Author

@javiermolinar fixed the conflicts and added dock @knylander-grafana, can you check please?

@javiermolinar
Copy link
Contributor

@javiermolinar fixed the conflicts and added dock @knylander-grafana, can you check please?

One pending comment and we are ready

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow configuring SSE for S3 backed storage
3 participants