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

Propagate tenant ID #10

Merged
merged 3 commits into from
Aug 5, 2020
Merged

Propagate tenant ID #10

merged 3 commits into from
Aug 5, 2020

Conversation

simonswine
Copy link
Collaborator

This add support for optional tenant IDs. It can recognize them both from the Basic Auth and the X-Scope-OrgID headers. The propagation is supported in all serialization formats using an optional fields. (This fixes #4 in most parts).

I have written some integration tests, which require a pulsar endpoint to target. I will investigate how we can run that as part of CI

@jtlisi if you get the chance, take a look happy to get some review esp. for the non integration test part of it.

Copy link
Member

@jdbaldry jdbaldry left a comment

Choose a reason for hiding this comment

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

Looks good to me! Hopefully Jacob can cast a more experienced eye over things.

I'm interested in how we implement the order verification of message entries. Would simply storing the previous message timestamp and doing a comparison on each receive be enough?

go.mod Outdated Show resolved Hide resolved
integration_test.go Outdated Show resolved Hide resolved
integration_test.go Outdated Show resolved Hide resolved
func NewJSONSerializer() *JSONSerializer {
return &JSONSerializer{}
type Sample struct {
Value model.SamplePair `json:"value"`
Copy link
Member

Choose a reason for hiding this comment

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

Would using Sample instead of Value as the struct field prevent the stuttering in "value": s.Value.Value.String(),?

Copy link
Collaborator Author

@simonswine simonswine Aug 4, 2020

Choose a reason for hiding this comment

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

I get your point, but I think I probably would prefer to use the same name here that is used in the JSON annotation field how it defined upstream:

https://github.com/prometheus/common/blob/217fd62d44a79db8f842113234ae9383b8374983/model/value.go#L115
https://github.com/prometheus/common/blob/217fd62d44a79db8f842113234ae9383b8374983/model/value.go#L144

This add support for optional tenant IDs. It can recognize them both
from the Basic Auth and the X-Scope-OrgID headers. The propagation is
supported in all serialization formats using an optional fields.
@simonswine simonswine force-pushed the handle-tenant-id branch 5 times, most recently from 8c99b37 to 5dccb4e Compare August 4, 2020 14:06
Download modules through `go mod download` first.
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.

Verify message format to publish on the bus
2 participants