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

Retain Grafana Cloud/GEM schema fields #502

Merged
merged 1 commit into from Feb 7, 2023
Merged

Retain Grafana Cloud/GEM schema fields #502

merged 1 commit into from Feb 7, 2023

Conversation

fionaliao
Copy link
Contributor

@fionaliao fionaliao commented Feb 6, 2023

For #501

Grafana Cloud and Grafana Enterprise Metrics adds two additional fields to the Graphite storage-schemas.conf: intervals and relativeToQuery. Documentation for these two fields: https://grafana.com/docs/enterprise-metrics/latest/graphite/schemas/#storage-schemas. Currently, the storage-schemas parser in CRNG drops these fields before uploading to Grafana Cloud/GEM. This PR fixes this - if either of these two fields are supplied for a rule, they will be uploaded as part of the storage-schemas.conf.

No validation is done on the intervals and relativeToQuery; we just copy over the string values from the input schemas file. This is because CRNG and Grafana Cloud/GEM have different storage-schemas.conf parsers. I didn't want to copy over the Grafana Cloud/GEM validation logic as we'd have to maintain two versions of the validation, and I wanted to implement something simple first to fix not being able to submit these fields at all. If there is a problem with intervals and relativeToQuery, the server-side validation will detect this and return a 400 error.

Ideally we should unify the schemas parsers in the future. That might cause some breaking changes though, so we'd have to be careful with how we approach that.

Testing

Tested this version of CRNG successfully uploads schemas with the intervals and relativeToQuery fields to Grafana Cloud

@fionaliao fionaliao force-pushed the fl/intervals branch 2 times, most recently from 7bd9229 to 706a797 Compare February 7, 2023 15:08
@fionaliao fionaliao changed the title Retain GrafanaNet/GEM schema fields Retain Grafana Cloud/GEM schema fields Feb 7, 2023
@fionaliao fionaliao marked this pull request as ready for review February 7, 2023 15:23
@fionaliao fionaliao merged commit eeeaa16 into master Feb 7, 2023
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.

None yet

2 participants