cat-a-logs 2.0.9 → 2.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/client/index.js +7 -5
  2. package/package.json +1 -1
package/client/index.js CHANGED
@@ -145,10 +145,12 @@ function catalog(trackedVariable_1, metricName_1) {
145
145
  //usable instance of the validation JSON
146
146
  const validateEmf = ajv.compile(emfSchema);
147
147
  //sort customerDimensions key values in alphabetical order. We will use this to keep the keys in our cache consistant. Since the order of the dimensions do not change where the metrics are stored
148
- const sortedDimensions = {};
149
- for (let i = 0; i < Object.keys(CustomerDefinedDimension).sort().length; i++) {
150
- sortedDimensions[Object.keys(CustomerDefinedDimension).sort()[i]] =
151
- CustomerDefinedDimension[Object.keys(CustomerDefinedDimension).sort()[i]];
148
+ // const sortedDimensions: { [key: string]: string } = {}; // Doesn't need to be an object. Made it a string
149
+ let sortedDimensions = '';
150
+ const sortedCustomerDimensions = Object.keys(CustomerDefinedDimension).sort();
151
+ for (let i = 0; i < sortedCustomerDimensions.length; i++) {
152
+ sortedDimensions +=
153
+ sortedCustomerDimensions[i];
152
154
  }
153
155
  //Check if Object with Namespace and Dimensions already exists in cache
154
156
  let check = cache[`${metricNamespace}${sortedDimensions}`];
@@ -171,7 +173,7 @@ function catalog(trackedVariable_1, metricName_1) {
171
173
  CloudWatchMetrics: [
172
174
  {
173
175
  Namespace: metricNamespace,
174
- Dimensions: [Object.keys(sortedDimensions)],
176
+ Dimensions: sortedCustomerDimensions,
175
177
  Metrics: [
176
178
  {
177
179
  Name: metricName,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cat-a-logs",
3
- "version": "2.0.9",
3
+ "version": "2.0.10",
4
4
  "description": "Create & send structured logs to AWS Cloudwatch logs",
5
5
  "main": "index.js",
6
6
  "exports": {