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 support for setting retention policy using tag #7141

Merged
merged 1 commit into from
Mar 10, 2020

Conversation

danielnelson
Copy link
Contributor

closes #7053

Required for all PRs:

  • Signed CLA.
  • Associated README.md updated.
  • Has appropriate unit tests.

@danielnelson danielnelson added the feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin label Mar 9, 2020
@danielnelson danielnelson added this to the 1.14.0 milestone Mar 9, 2020
type dbrp struct {
Database string
RetentionPolicy string
}
Copy link
Contributor

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

Copy link
Contributor Author

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 {
Copy link
Contributor

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

Copy link
Contributor Author

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

@danielnelson danielnelson merged commit c7146be into master Mar 10, 2020
@danielnelson danielnelson deleted the influxdb-add-rp-tag branch March 10, 2020 22:20
Trovalo pushed a commit to Trovalo/telegraf that referenced this pull request Mar 11, 2020
athoune pushed a commit to bearstech/telegraf that referenced this pull request Apr 17, 2020
veorlo pushed a commit to GlobalNOC/telegraf that referenced this pull request May 4, 2020
HarshitOnGitHub pushed a commit to HarshitOnGitHub/telegraf that referenced this pull request May 8, 2020
idohalevi pushed a commit to idohalevi/telegraf that referenced this pull request Sep 29, 2020
arstercz pushed a commit to arstercz/telegraf that referenced this pull request Mar 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/influxdb feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow RP to be set from a tag
2 participants