@@ -2,12 +2,12 @@ import { URL } from "url";
2
2
import { post , logDebug , logError } from "../utils" ;
3
3
import fs from "fs" ;
4
4
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" ;
7
6
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 ;
9
9
10
- export async function isAgentRunning ( ) {
10
+ export async function isExtensionRunning ( ) {
11
11
const extensionExists = await fileExists ( EXTENSION_PATH ) ;
12
12
if ( ! extensionExists ) {
13
13
logDebug ( `Agent isn't present in sandbox` ) ;
@@ -17,8 +17,8 @@ export async function isAgentRunning() {
17
17
}
18
18
19
19
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 } ) ;
22
22
if ( ! result . success ) {
23
23
logError ( `Failed to flush extension. ${ result . errorMessage } ` ) ;
24
24
return false ;
0 commit comments