-
Notifications
You must be signed in to change notification settings - Fork 14
CLOUDP-294461: [Product Metrics/Observability] Implement Metric Collection workflow #357
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
Conversation
Ran the code locally and noticed I had to run the script twice, the first time I got this error:
With some debugging it seems like |
const config = { | ||
defaultOasFilePath: path.join(rootDir, 'openapi', 'v2.json'), | ||
defaultCollectorResultsFilePath: path.join(dirname, 'ipa-collector-results-combined.log'), | ||
defaultRulesetFilePath: path.join(dirname, '..', 'ipa-spectral.yaml'), | ||
defaultMetricCollectionResultsFilePath: path.join(dirname, 'metric-collection-results.json'), | ||
}; |
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 give an example how we can set different configurations? For the GH action later on we'd like to point to the generated FOAS for example
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 script currently supports providing a custom OAS file only, which must be in JSON format.
For example, you can run the script using:
node metricCollection.js "<path_to_oas_file>"
to specify a custom OAS file.
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.
Nice, LGTM!
Proposed changes
Jira ticket: CLOUDP-294461
metricCollectionJob
implements the workflow for metric collection:metric-collection-results.json
metricCollectionJob
allows custom OAS files, but the default is thev2.json
Example:
node metricCollection.js <path-to-OAS-file>
metricCollectionJob
produces a couple of output files:/outputs/metric-collection-results.json
: The data collected for metrics/outputs/spectral-output.txt
: Output of spectral command/outputs/spectral-report.xml
: Report for the errorsipa-collector-results-combined.log
: This file is intended to store the collector results. However, it does not appear to be populated whenmetricCollection.js
is executed, even thoughmetric-collection-results.json
, which is constructed using this file, is populated correctly.Testing
Example output file:
metric-collection-results.json
Checklist
Changes to Spectral