@tryghost/metrics 0.1.3 → 0.1.4

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.
@@ -60,6 +60,8 @@ class GhostMetrics {
60
60
 
61
61
  /**
62
62
  * @description Setup ElasticSearch metric shipper
63
+ * ElasticSearch metrics are shipped to an index individually for each metric.
64
+ * The name of the index is the name of the metric prefixed with "metrics-", the metric name itself should be sluggified
63
65
  */
64
66
  setupElasticsearchShipper() {
65
67
  const ElasticSearch = require('@tryghost/elasticsearch');
@@ -77,9 +79,10 @@ class GhostMetrics {
77
79
  value = {value};
78
80
  }
79
81
 
82
+ value['@timestamp'] = Date.now();
80
83
  value.domain = this.domain;
81
84
 
82
- elasticSearch.index(value, name);
85
+ elasticSearch.index(value, `metrics-${name}`);
83
86
  };
84
87
  }
85
88
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryghost/metrics",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "repository": "https://github.com/TryGhost/framework/tree/main/packages/metrics",
5
5
  "author": "Ghost Foundation",
6
6
  "license": "MIT",
@@ -28,5 +28,5 @@
28
28
  "dependencies": {
29
29
  "@tryghost/pretty-stream": "^0.1.1"
30
30
  },
31
- "gitHead": "90fab655c5bb4f16dd5604fc65be0ae599021e10"
31
+ "gitHead": "fe23e284f825182a543091fb0b87e9dee46146e4"
32
32
  }