remove-azure-monitor
Skill316 starsChanged 5 months agoMITView on GitHub
Completely remove the Azure Monitor / Application Insights telemetry exporter from this monorepo while keeping pino structured logging (@repo/logging) and OpenTelemetry trace context intact. Use whenever the user wants to drop Azure Monitor, remove Application Insights, delete @azure/monitor-opentelemetry, remove the @repo/logging/azure target, or stop shipping logs/traces to Azure. The logger (logger/logError/withSpan) and all its call sites must keep working — only the Azure exporter goes.
- Reads credentials
- Installs packages
In this repository25 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .claude/skills/vercel-react-best-practices/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- add-content-typeSkill
- add-localeSkill
- add-ui-componentSkill
- consolidate-patternsSkill
- copy-componentSkill
- create-content-componentSkill
- find-componentSkill
- find-skillsSkill
- frontend-designSkill
- make-prSkill
- next-best-practicesSkill
- remove-cache-revalidationSkill
- remove-cdn-purgeSkill
- remove-sentrySkill
- resolve-review-suggestionsSkill
- review-prSkill
- seed-contentSkill
- start-workSkill
- strapi-schema-checkSkill
- validate-branch-refsSkill
- vercel-react-best-practicesSkill
- write-testsSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 2 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 17
Remove the Azure Monitor / Application Insights exporter (@azure/monitor-opentelemetry, the @repo/logging/azure subpath, and the …
- Very specific: line 19
without touching pino logging or OpenTelemetry trace context: After this skill runs, the apps still log structured JSON via @repo/logging …
- Very specific: line 31
Every logger.* / logError(...) / withSpan(...) call site.
- Very specific: line 39
If the user also wants Sentry gone, that is the separate remove-sentry skill.
- Very specific: line 50
Remove the "./azure" entry from exports.
- Very specific: line 51
Remove "@azure/monitor-opentelemetry" from dependencies.
- Very specific: line 52
Keep pino and @opentelemetry/api.
- Very specific: line 64
Default (keep scaffold): leave apps/strapi/src/telemetry/ and apps/strapi/src/instrumentation.ts in place with an empty providers array — …
- Very specific: line 65
Or remove the scaffold: delete apps/strapi/src/telemetry/ and apps/strapi/src/instrumentation.ts, and remove the import "./instrumentation" …
- Distinctive: line 67
Ask the user which they prefer if it is not obvious from context.
- Distinctive: line 100
Run these and confirm they pass (Node engine warnings are expected and harmless):
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Remove Azure Monitor
Remove the Azure Monitor / Application Insights exporter (@azure/monitor-opentelemetry,
the @repo/logging/azure subpath, and the azure-monitor telemetry providers)
without touching pino logging or OpenTelemetry trace context. After this
skill runs, the apps still log structured JSON via @repo/logging and still
create spans with withSpan — those logs/traces just aren't exported to Azure.
What stays vs. what goes
Keep (this is the "structural logging tool" the user wants to retain):
packages/logging/index.ts— pino logger,createLogging,logError,withSpan.@opentelemetry/apidependency —withSpanand trace-context correlation use it. This is the OTel API, not the Azure exporter. Do not remove it.- The app wrappers
apps/ui/src/lib/logging.ts,apps/strapi/src/utils/logging.ts. OTEL_SERVICE_NAMEandLOG_LEVELenv vars — the pino wrapper reads these for the service name and level. Keep them everywhere (env.mjs, turbo.json,.env.example).- Every
logger.*/logError(...)/withSpan(...)call site.
Remove (the Azure exporter only):
@azure/monitor-opentelemetrydependency andpackages/logging/azure.ts.- The
azure-monitortelemetry providers and their registry entries. APPLICATIONINSIGHTS_CONNECTION_STRINGenv var.
If the user also wants Sentry gone, that is the separate remove-sentry skill.
Procedure
Work top-down, then run the discovery grep to catch leftovers. If --dry-run is
passed, report the planned changes instead of editing.
1. The shared package
- Delete
packages/logging/azure.ts. packages/logging/package.json:- Remove the
"./azure"entry fromexports. - Remove
"@azure/monitor-opentelemetry"fromdependencies. - Keep
pinoand@opentelemetry/api.
- Remove the
2. UI telemetry provider
- Delete
apps/ui/src/lib/telemetry/providers/azure-monitor.ts. apps/ui/src/lib/telemetry/index.ts: remove theimport { azureMonitorProvider } from "./providers/azure-monitor"line and its entry in the providers array. (LeavesentryProvider()if present.)
3. Strapi telemetry provider
- Delete
apps/strapi/src/telemetry/providers/azure-monitor.ts. apps/strapi/src/telemetry/index.ts: remove theazureMonitorProviderimport and array entry.Azure is currently Strapi's only telemetry provider. With it gone the registry has no providers. Choose based on intent:
- Default (keep scaffold): leave
apps/strapi/src/telemetry/andapps/strapi/src/instrumentation.tsin place with an empty providers array —initializeTelemetry()becomes a harmless no-op, ready for a future provider. - Or remove the scaffold: delete
apps/strapi/src/telemetry/andapps/strapi/src/instrumentation.ts, and remove theimport "./instrumentation"line fromapps/strapi/src/index.ts. Do NOT remove thelogger.info("Strapi bootstrap …")calls or theimport { logger } from "./utils/logging".
Ask the user which they prefer if it is not obvious from context.
- Default (keep scaffold): leave
4. UI next.config
apps/ui/next.config.mjs: inserverExternalPackages, remove"@azure/monitor-opentelemetry". Keep"pino"and"pino-pretty"— pino still needs to be a server external.
5. Env + shared config
apps/ui/src/env.mjs: removeAPPLICATIONINSIGHTS_CONNECTION_STRINGfrom the server schema block andruntimeEnv. KeepOTEL_SERVICE_NAMEandLOG_LEVEL.turbo.jsonglobalEnv: removeAPPLICATIONINSIGHTS_CONNECTION_STRING. KeepOTEL_SERVICE_NAMEandLOG_LEVEL.apps/ui/.env.local.exampleandapps/strapi/.env.example: remove theAPPLICATIONINSIGHTS_CONNECTION_STRINGline (and the "Azure Monitor … telemetry provider" comment). Keep theLOG_LEVELandOTEL_SERVICE_NAMElines.
6. Docs
apps/docs/docs/reference/integrations/logging.md: delete the## Azure Monitor / Application Insightssection. Update the intro line that lists bundled providers so it no longer names Azure Monitor. If Sentry is still present it remains the documented provider; if no providers remain, reword the page to describe stdout-only logging with the provider pattern available for future backends.apps/docs/docs/reference/packages/logging.md: remove the./azurerow from the Exports table and any@repo/logging/azure/ Azure mention; update "Related Documentation" to drop Azure Monitor.apps/docs/docs/strapi/environment-variables.md: remove theAPPLICATIONINSIGHTS_CONNECTION_STRINGtable row. KeepLOG_LEVELandOTEL_SERVICE_NAMErows.
7. Reinstall + discovery sweep
pnpm install
pnpm -F @repo/logging build # rebuild dist without azure.ts
# Catch anything missed (ignore node_modules / build output):
grep -rin "azure.monitor\|applicationinsights\|monitor-opentelemetry\|@repo/logging/azure\|azureMonitor" apps packages turbo.json .env* --include="*.ts" --include="*.tsx" --include="*.mjs" --include="*.json" --include="*.md" 2>/dev/null | grep -v node_modulesNote: @repo/logging/azure is distinct from the Azure Front Door CDN purge
provider (apps/ui/src/lib/cdn/providers/azure-front-door.ts and the AZURE_*
CDN env vars). The CDN integration is unrelated — do not remove it.
Verify
Run these and confirm they pass (Node engine warnings are expected and harmless):
pnpm -F @repo/logging build
pnpm -F @repo/ui exec tsc --noEmit
pnpm -F @repo/strapi exec tsc --noEmit -p tsconfig.json
pnpm -F @repo/ui build
pnpm -F @repo/ui test
pnpm -F @repo/strapi test
pnpm -F @repo/docs build # fails on broken links — confirms no dangling Azure Monitor refsConfirm logging still works: @repo/logging still exports logger/logError/withSpan,
@opentelemetry/api is still a dependency, and withSpan call sites still typecheck.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

