Skip to content

Commit dbc4ca4

Browse files
committed
rename agent to extension
1 parent 3ae6bc3 commit dbc4ca4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/metrics/extension.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ import { URL } from "url";
22
import { post, logDebug, logError } from "../utils";
33
import fs from "fs";
44

5-
export const AGENT_URL = "http://127.0.0.1:8124";
6-
const FLUSH_PATH = "/lambda/flush";
5+
export const EXTENSION_URL = "http://127.0.0.1:8124";
76
const EXTENSION_PATH = "/opt/extensions/datadog-agent";
8-
const AGENT_TIMEOUT_MS = 100;
7+
const LOCAL_FLUSH_PATH = "/lambda/flush";
8+
const LOCAL_FLUSH_TIMEOUT_MS = 100;
99

10-
export async function isAgentRunning() {
10+
export async function isExtensionRunning() {
1111
const extensionExists = await fileExists(EXTENSION_PATH);
1212
if (!extensionExists) {
1313
logDebug(`Agent isn't present in sandbox`);
@@ -17,8 +17,8 @@ export async function isAgentRunning() {
1717
}
1818

1919
export async function flushExtension(): Promise<boolean> {
20-
const url = new URL(FLUSH_PATH, AGENT_URL);
21-
const result = await post(url, {}, { timeout: AGENT_TIMEOUT_MS });
20+
const url = new URL(LOCAL_FLUSH_PATH, EXTENSION_URL);
21+
const result = await post(url, {}, { timeout: LOCAL_FLUSH_TIMEOUT_MS });
2222
if (!result.success) {
2323
logError(`Failed to flush extension. ${result.errorMessage}`);
2424
return false;

0 commit comments

Comments
 (0)