@certik/skynet 0.18.1 → 0.18.2
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/CHANGELOG.md +4 -0
- package/package.json +1 -1
- package/search.d.ts +0 -1
- package/search.js +2 -2
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
package/search.d.ts
CHANGED
package/search.js
CHANGED
|
@@ -3,7 +3,7 @@ import { inline } from "./log.js";
|
|
|
3
3
|
import { Client } from "@elastic/elasticsearch";
|
|
4
4
|
import osModule from "os";
|
|
5
5
|
|
|
6
|
-
export async function sendToSearch(
|
|
6
|
+
export async function sendToSearch(indexPrefix, record, throws = false) {
|
|
7
7
|
const client = new Client({
|
|
8
8
|
cloud: { id: process.env.SKYNET_ELASTICSEARCH_CLOUD_ID },
|
|
9
9
|
auth: { apiKey: process.env.SKYNET_ELASTICSEARCH_API_KEY },
|
|
@@ -17,7 +17,7 @@ export async function sendToSearch(appName, indexPrefix, record, throws = false)
|
|
|
17
17
|
try {
|
|
18
18
|
await client.index({
|
|
19
19
|
index: indexName,
|
|
20
|
-
document: {
|
|
20
|
+
document: { instance: osModule.hostname(), timestamp: now, record },
|
|
21
21
|
});
|
|
22
22
|
} catch (err) {
|
|
23
23
|
inline.error(err);
|