-
Notifications
You must be signed in to change notification settings - Fork 81
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
support for persistent data #15
Comments
Offtopic: How do you archive the data? Do you use an open source tool or do you just call the api everyday and save its data? |
Thanks for your feedback @billimek
This is something that is being considered for a next phase. |
It's just a call to the API and merging it with an existing json file. This is how we're now handling this, via a GitHub action workflow, to override the original mocked data json as an interim way to have longer-lived persisted data: DATE=$(date +"%Y%m%d")
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.COPILOT_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/orgs/<our org>/copilot/usage > data_${DATE}.json
jq -s 'add | unique_by(.day) | sort_by(.day)' data_${DATE}.json src/assets/copilot_metrics_response_sample.json > data_merged_${DATE}.json && mv data_merged_${DATE}.json src/assets/copilot_metrics_response_sample.json |
could potentially combine it with https://github.com/marketplace/actions/copilot-metrics-retention |
As documented, the API contains metrics for the prior 28 days. It would be useful if there would be a way to configure this to support a 'local' json file containing longer-term data (e.g. we currently periodically merge the results into a larger json file with more historical data). Or, perhaps, support an external datasource where the API results are collected and persisted for a longer historical view.
The text was updated successfully, but these errors were encountered: