@tryghost/metrics 1.0.1 → 1.0.5

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.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2013-2021 Ghost Foundation
3
+ Copyright (c) 2013-2022 Ghost Foundation
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -36,4 +36,4 @@ Follow the instructions for the top-level repo.
36
36
 
37
37
  # Copyright & License
38
38
 
39
- Copyright (c) 2013-2021 Ghost Foundation - Released under the [MIT license](LICENSE).
39
+ Copyright (c) 2013-2022 Ghost Foundation - Released under the [MIT license](LICENSE).
@@ -13,7 +13,7 @@ try {
13
13
  class GhostMetrics {
14
14
  /**
15
15
  * Properties in the options bag:
16
- *
16
+ *
17
17
  * domain: Metadata for metrics in shared databases.
18
18
  * mode: Is used to print short or long log - used for stdout shipper.
19
19
  * metrics.transports: An array of transports for metric shipping (e.g. ['stdout', 'elasticsearch'])
@@ -97,7 +97,10 @@ class GhostMetrics {
97
97
  value = {value};
98
98
  }
99
99
 
100
- value['@timestamp'] = Date.now();
100
+ if (!('@timestamp' in value)) {
101
+ value['@timestamp'] = Date.now();
102
+ }
103
+
101
104
  if (this.metadata) {
102
105
  value.metadata = this.metadata;
103
106
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryghost/metrics",
3
- "version": "1.0.1",
3
+ "version": "1.0.5",
4
4
  "repository": "https://github.com/TryGhost/framework/tree/main/packages/metrics",
5
5
  "author": "Ghost Foundation",
6
6
  "license": "MIT",
@@ -19,20 +19,20 @@
19
19
  "access": "public"
20
20
  },
21
21
  "devDependencies": {
22
- "c8": "7.10.0",
23
- "mocha": "9.1.3",
24
- "rewire": "5.0.0",
22
+ "c8": "7.11.0",
23
+ "mocha": "9.2.0",
24
+ "rewire": "6.0.0",
25
25
  "should": "13.2.3",
26
- "sinon": "11.1.2"
26
+ "sinon": "13.0.1"
27
27
  },
28
28
  "dependencies": {
29
- "@tryghost/elasticsearch": "^1.0.0",
30
- "@tryghost/pretty-stream": "^0.1.2",
31
- "@tryghost/root-utils": "^0.3.7",
29
+ "@tryghost/elasticsearch": "^1.0.3",
30
+ "@tryghost/pretty-stream": "^0.1.5",
31
+ "@tryghost/root-utils": "^0.3.10",
32
32
  "json-stringify-safe": "^5.0.1"
33
33
  },
34
34
  "optionalDependencies": {
35
35
  "promise.allsettled": "^1.0.5"
36
36
  },
37
- "gitHead": "27b58da37b584f76af731b6a3f5b5023aa0b6c12"
37
+ "gitHead": "6886d270eb4d959245657c0b4c593e7b1b8000eb"
38
38
  }