Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ ENDPOINT_L1_SUCCESS="/success/l1"
L1_TOKEN_EXPIRATION=60
L1_TOKEN_HEADER_NAME=x-token
L2_TOKEN_EXPIRATION=3600
APPINSIGHTS_INSTRUMENTATIONKEY=foo
APPLICATIONINSIGHTS_CONNECTION_STRING=InstrumentationKey=foo;IngestionEndpoint=http://localhost;LiveEndpoint=http://localhost
REQUIRED_ATTRIBUTES_SERVICE_NAME=Service Name

ENABLE_FULL_OPERATOR_METADATA=true
Expand Down
2 changes: 1 addition & 1 deletion e2e/scenarios/basic/env.scenario
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ ENDPOINT_L1_SUCCESS="/success/l1"
L1_TOKEN_EXPIRATION=60
L1_TOKEN_HEADER_NAME=x-token
L2_TOKEN_EXPIRATION=3600
APPINSIGHTS_INSTRUMENTATIONKEY=foo
APPLICATIONINSIGHTS_CONNECTION_STRING=InstrumentationKey=foo;IngestionEndpoint=http://localhost;LiveEndpoint=http://localhost
REQUIRED_ATTRIBUTES_SERVICE_NAME=Service Name

ENABLE_FULL_OPERATOR_METADATA=true
Expand Down
2 changes: 1 addition & 1 deletion e2e/scenarios/with-aws-s3/env.scenario
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ ENDPOINT_L1_SUCCESS="/success/l1"
L1_TOKEN_EXPIRATION=60
L1_TOKEN_HEADER_NAME=x-token
L2_TOKEN_EXPIRATION=3600
APPINSIGHTS_INSTRUMENTATIONKEY=foo
APPLICATIONINSIGHTS_CONNECTION_STRING=InstrumentationKey=foo;IngestionEndpoint=http://localhost;LiveEndpoint=http://localhost
REQUIRED_ATTRIBUTES_SERVICE_NAME=Service Name

ENABLE_FULL_OPERATOR_METADATA=true
Expand Down
2 changes: 1 addition & 1 deletion e2e/scenarios/with-redis-cluster/env.scenario
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ ENDPOINT_L1_SUCCESS="/success/l1"
L1_TOKEN_EXPIRATION=60
L1_TOKEN_HEADER_NAME=x-token
L2_TOKEN_EXPIRATION=3600
APPINSIGHTS_INSTRUMENTATIONKEY=foo
APPLICATIONINSIGHTS_CONNECTION_STRING=InstrumentationKey=foo;IngestionEndpoint=http://localhost;LiveEndpoint=http://localhost
REQUIRED_ATTRIBUTES_SERVICE_NAME=Service Name

ENABLE_FULL_OPERATOR_METADATA=true
Expand Down
9 changes: 6 additions & 3 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ import { getConfigOrThrow } from "./utils/config";
import { logger } from "./utils/logger";

const config = getConfigOrThrow();
const appInsights = initAppInsights(config.APPINSIGHTS_INSTRUMENTATIONKEY, {
disableAppInsights: config.APPINSIGHTS_DISABLED
});
const appInsights = initAppInsights(
config.APPLICATIONINSIGHTS_CONNECTION_STRING,
{
disableAppInsights: config.APPINSIGHTS_DISABLED
}
);

// eslint-disable-next-line functional/immutable-data
appInsights.context.tags[appInsights.context.keys.cloudRole] =
Expand Down
4 changes: 2 additions & 2 deletions src/utils/appinsights.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import * as appInsights from "applicationinsights";
* - Realtime API metrics
*/
export const initAppInsights = (
instrumentationKey: string,
connectionString: string,
config: ApplicationInsightsConfig = {}
): appInsights.TelemetryClient => {
startAppInsights(instrumentationKey, config);
startAppInsights(connectionString, config);
return appInsights.defaultClient;
};
2 changes: 1 addition & 1 deletion src/utils/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ export type IConfigUtility = t.TypeOf<typeof IConfigUtility>;
export const IConfigUtility = t.intersection([
t.interface({
APPINSIGHTS_DISABLED: t.boolean,
APPINSIGHTS_INSTRUMENTATIONKEY: NonEmptyString,
APPLICATIONINSIGHTS_CONNECTION_STRING: NonEmptyString,
SERVER_PORT: NonNegativeInteger,
isProduction: t.boolean
}),
Expand Down
Loading