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 metadata ADR #194
Add metadata ADR #194
Conversation
Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
adr/ADR-00.md
Outdated
... // other consumer/stream fields | ||
"metadata": { | ||
"owner": "nack", | ||
"domain": "product" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
considering we could add some private internal metadata namespace when it starts with underscore like "_created_nats_version":"2.10.0"
that is immutable and we can pinpoint the origin of the objects for debugging, also via the metadata fields would be useful to stamp whether it was created for a KV/ObjectStore usage for example as a hint for debugging and troubleshooting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The internal namespace is a good idea!
Maybe _nats
?
Those could be use by both client internals and the server.
Server could ensure immutability of its entries.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_nats
sounds good 👍
Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
Improved ADR after discussions:
|
Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
@ripienaar @wallyqs ADR updated, PR updated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
Metadata for Stream and Consumer
Context and Problem Statement
Until now, there was no way to easily add additional information about Stream or Consumer.
The only solution was using
Description
field, which is a ugly workaround.Server PR
nats-io/nats-server#3797
Design
The solution is to add new
metadata
field to bothConsumer
andStream
config.The
metadata
field would by a map ofstring
keys andstring
values.The map would be represented in json as object with nested key/value pairs, which is a default
way to marshal maps/hashmaps in most languages.
Example
Open questions
Do we want to limit the size of
metadata
?Signed-off-by: Tomasz Pietrek tomasz@nats.io