Skip to content
This repository has been archived by the owner on Jan 15, 2025. It is now read-only.

[#IOPID-1944] Upgrade appingights sdk and config #51

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
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
4 changes: 1 addition & 3 deletions ActivatePubKey/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ const assertionBlobService = createBlobService(
config.LOLLIPOP_ASSERTION_STORAGE_CONNECTION_STRING
);

const telemetryClient = initTelemetryClient(
config.APPINSIGHTS_INSTRUMENTATIONKEY
);
const telemetryClient = initTelemetryClient(config);

// eslint-disable-next-line functional/no-let
let logger: Context["log"];
Expand Down
4 changes: 1 addition & 3 deletions GenerateLCParams/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ import { GenerateLCParams } from "./handler";

const config = getConfigOrThrow();

const telemetryClient = initTelemetryClient(
config.APPINSIGHTS_INSTRUMENTATIONKEY
);
const telemetryClient = initTelemetryClient(config);

// eslint-disable-next-line functional/no-let
let logger: Context["log"];
Expand Down
4 changes: 1 addition & 3 deletions GetAssertion/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ import { GetAssertion } from "./handler";

const config = getConfigOrThrow();

const telemetryClient = initTelemetryClient(
config.APPINSIGHTS_INSTRUMENTATIONKEY
);
const telemetryClient = initTelemetryClient(config);

const lollipopKeysModel = new LolliPOPKeysModel(
cosmosdbInstance.container(LOLLIPOPKEYS_COLLECTION_NAME)
Expand Down
4 changes: 1 addition & 3 deletions HandlePubKeyRevoke/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ const lollipopKeysModel = new LolliPOPKeysModel(
cosmosdbInstance.container(LOLLIPOPKEYS_COLLECTION_NAME)
);

const telemetryClient = initTelemetryClient(
config.APPINSIGHTS_INSTRUMENTATIONKEY
);
const telemetryClient = initTelemetryClient(config);

export const index: AzureFunction = (
context: Context,
Expand Down
5 changes: 5 additions & 0 deletions Info/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,17 @@ import * as express from "express";
import { secureExpressApp } from "@pagopa/io-functions-commons/dist/src/utils/express";
import { setAppContext } from "@pagopa/io-functions-commons/dist/src/utils/middlewares/context_middleware";
import createAzureFunctionHandler from "@pagopa/express-azure-functions/dist/src/createAzureFunctionsHandler";
import { initTelemetryClient } from "../utils/appinsights";
import { getConfigOrThrow } from "../utils/config";
import { Info } from "./handler";

const config = getConfigOrThrow();
// Setup Express
const app = express();
secureExpressApp(app);

initTelemetryClient(config);

// Add express route
app.get("/info", Info());

Expand Down
4 changes: 1 addition & 3 deletions ReservePubKey/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ const lollipopPubkeysModel = new LolliPOPKeysModel(
cosmosdbInstance.container(LOLLIPOPKEYS_COLLECTION_NAME)
);

const telemetryClient = initTelemetryClient(
config.APPINSIGHTS_INSTRUMENTATIONKEY
);
const telemetryClient = initTelemetryClient(config);

// eslint-disable-next-line functional/no-let
let logger: Context["log"];
Expand Down
2 changes: 1 addition & 1 deletion __integrations__/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ services:
- ${COSMOSDB_PORT}:3000

storage-account:
image: mcr.microsoft.com/azure-storage/azurite:3.9.0
image: mcr.microsoft.com/azure-storage/azurite:3.31.0
ports:
- 10000:10000
- 10001:10001
Expand Down
6 changes: 5 additions & 1 deletion __integrations__/environments/env.function
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ AzureWebJobsStorage=${STORAGE_CONN_STRING}
AZURE_ENABLE_STRICT_SSL=false
NODE_TLS_REJECT_UNAUTHORIZED=0

APPINSIGHTS_INSTRUMENTATIONKEY=foo
APPINSIGHTS_CLOUD_ROLE_NAME=io-d-local-fn-lollipop
APPLICATIONINSIGHTS_CONNECTION_STRING=InstrumentationKey=foo;IngestionEndpoint=http://localhost;LiveEndpoint=http://localhost
APPINSIGHTS_DISABLE=true
APPINSIGHTS_EXCLUDED_DOMAINS="127.0.0.1,localhost,storage-account"

LOLLIPOP_ASSERTION_STORAGE_CONNECTION_STRING=${LOLLIPOP_ASSERTION_STORAGE_CONNECTION_STRING}
LOLLIPOP_ASSERTION_REVOKE_QUEUE=${LOLLIPOP_ASSERTION_REVOKE_QUEUE}

Expand Down
4 changes: 2 additions & 2 deletions __integrations__/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"dependencies": {
"@azure/cosmos": "^3.17.2",
"@azure/storage-queue": "^12.7.0",
"@pagopa/io-functions-commons": "^27.3.0",
"@pagopa/io-functions-commons": "^28.22.0",
"@types/jest": "^27.0.2",
"@types/node": "^13.11.0",
"azure-storage": "^2.10.5",
Expand All @@ -33,7 +33,7 @@
"ts-jest": "^27.0.7"
},
"devDependencies": {
"@pagopa/openapi-codegen-ts": "^10.0.5",
"@pagopa/openapi-codegen-ts": "^13.2.0",
"dotenv-cli": "^4.1.0",
"envsub": "^4.0.7",
"npm-run-all": "^4.1.5",
Expand Down
Loading
Loading