-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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 support for setting retention policy using tag #7141
Conversation
type dbrp struct { | ||
Database string | ||
RetentionPolicy string | ||
} |
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.
can you have the same database with different retention policies? The map below would seem to imply so
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.
Yes, this is the most common case actually. I conceptualize this by thinking about all points being inside a database+retention_policy (not just the database). If no rp is set, values will go into the default autogen
rp.
This means you could have 2 exactly the same values at the same timestamp in the same database, and only by querying with the full "dbrp" will you be able to tell them apart. It can be confusing to see because normally the retention policy is not seen.
} | ||
return nil | ||
} | ||
|
||
func (c *httpClient) writeBatch(ctx context.Context, db string, metrics []telegraf.Metric) error { | ||
url, err := makeWriteURL(c.config.URL, db, c.config.RetentionPolicy, c.config.Consistency) | ||
func (c *httpClient) writeBatch(ctx context.Context, db, rp string, metrics []telegraf.Metric) error { |
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.
rp might not be super clear as retentionPolicy
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.
Agreed, but I think it should be okay as it matches InfluxDB lingo https://docs.influxdata.com/influxdb/v1.7/concepts/glossary#retention-policy-rp
closes #7053
Required for all PRs: