Add aggregation telemetry by DaveTryon · Pull Request #1128 · microsoft/sbom-tool (original) (raw)
This PR adds the package count and relationship count for each AggregationSource to the telemetry stream. Steps to this point:
- Adds
Events.SbomAggregationWorkflowso we can record this as a discrete event - Adds
AggregationSource.Identifierand uses it for validation logs. We'll also use it for reporting package information in telemetry - Add a top-level exception handler to
SbomAggregationWorkflow.RunAsyncso that we can catch and log the exceptions - Adds a small refactor to the code that calls the various
GenerateAsyncmethods, so that aggregation calls only the generators that need to be called. Aggregating relationships will occur in a later feature. - Add
IRecorder.RecordAggregationSourceand its implementation to capture the data - Call
IRecorder.RecordAggregationSourcefrom the workflow
When all the pieces land, we get the following added to the telemetry stream:
AggregationSourceTelemetry = {
["1832146932"]=AggregationSourceTelemetry {PackageCount=266, RelationshipCount=0},
["1810187031"]=AggregationSourceTelemetry {PackageCount=3, RelationshipCount=0}
}
I'd love to remove the "AggregationSourceTelemetry" prefix on each item, but so far I haven't found a way to make that happen.