Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

Commit

Permalink
fix: convert remaining meta to labels and fix incorrect buckets
Browse files Browse the repository at this point in the history
  • Loading branch information
digitalsadhu committed Jan 24, 2020
1 parent 1085e50 commit 20da50b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,19 +129,19 @@ module.exports = class AssetPipeClient {
this.publishAllMetric = this.metrics.histogram({
name: 'publish_all_assets_timer',
description: 'Time spent on publishing all assets to asset server',
meta: { buckets: [1, 5, 10, 15, 20, 30, 60, 120] }
buckets: [1, 5, 10, 15, 20, 30, 60, 120]
});

this.publishMetric = this.metrics.histogram({
name: 'publish_assets_timer',
description: 'Time spent publishing assets',
meta: { buckets: [1, 5, 10, 15, 20, 30, 60, 120] }
buckets: [1, 5, 10, 15, 20, 30, 60, 120]
});

this.publishInstructionsMetric = this.metrics.histogram({
name: 'publish_instructions_timer',
description: 'Time spent publishing instructions',
meta: { buckets: [1, 5, 10, 15, 20, 30, 60, 120] }
buckets: [1, 5, 10, 15, 20, 30, 60, 120]
});
}

Expand Down Expand Up @@ -383,7 +383,7 @@ module.exports = class AssetPipeClient {
const { message } = body;

if (statusCode === 200) {
metricEnd({ meta: { assetType: type, statusCode } });
metricEnd({ labels: { assetType: type, statusCode } });
this.log.debug(
`${type} asset feed successfully published to asset server "${this.buildServerUri}" as files "${body.id}.json" and "${body.id}.${type}"`
);
Expand All @@ -402,7 +402,7 @@ module.exports = class AssetPipeClient {
);
} catch (err) {
metricEnd({
meta: { assetType: type, statusCode: err.statusCode || 500 }
labels: { assetType: type, statusCode: err.statusCode || 500 }
});

throw err;
Expand Down Expand Up @@ -455,7 +455,7 @@ module.exports = class AssetPipeClient {
const { message } = body;

if ([200, 204].includes(statusCode)) {
metricEnd({ meta: { assetType: type, statusCode } });
metricEnd({ labels: { assetType: type, statusCode } });
this.log.debug(
`${type} asset bundling instructions successfully published to asset server "${
this.buildServerUri
Expand All @@ -478,7 +478,7 @@ module.exports = class AssetPipeClient {
);
} catch (err) {
metricEnd({
meta: { assetType: type, statusCode: err.statusCode || 500 }
labels: { assetType: type, statusCode: err.statusCode || 500 }
});

throw err;
Expand Down

0 comments on commit 20da50b

Please sign in to comment.