agentleFS
notum-cznotum-cz/strapi-next-monorepo-starter/.claude/skills/remove-azure-monitor/SKILL.md

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

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
  1. Very specific:

    Remove the Azure Monitor / Application Insights exporter (@azure/monitor-opentelemetry, the @repo/logging/azure subpath, and the …

    line 17
  2. Very specific:

    without touching pino logging or OpenTelemetry trace context: After this skill runs, the apps still log structured JSON via @repo/logging …

    line 19
  3. Very specific:

    Every logger.* / logError(...) / withSpan(...) call site.

    line 31
  4. Very specific:

    If the user also wants Sentry gone, that is the separate remove-sentry skill.

    line 39
  5. Very specific:

    Remove the "./azure" entry from exports.

    line 50
  6. Very specific:

    Remove "@azure/monitor-opentelemetry" from dependencies.

    line 51
  7. Very specific:

    Keep pino and @opentelemetry/api.

    line 52
  8. Very specific:

    Default (keep scaffold): leave apps/strapi/src/telemetry/ and apps/strapi/src/instrumentation.ts in place with an empty providers array — …

    line 64
  9. Very specific:

    Or remove the scaffold: delete apps/strapi/src/telemetry/ and apps/strapi/src/instrumentation.ts, and remove the import "./instrumentation" …

    line 65
  10. Distinctive:

    Ask the user which they prefer if it is not obvious from context.

    line 67
  11. Distinctive:

    Run these and confirm they pass (Node engine warnings are expected and harmless):

    line 100

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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/api dependency — withSpan and 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_NAME and LOG_LEVEL env 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-opentelemetry dependency and packages/logging/azure.ts.
  • The azure-monitor telemetry providers and their registry entries.
  • APPLICATIONINSIGHTS_CONNECTION_STRING env 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 from exports.
    • Remove "@azure/monitor-opentelemetry" from dependencies.
    • Keep pino and @opentelemetry/api.

2. UI telemetry provider

  • Delete apps/ui/src/lib/telemetry/providers/azure-monitor.ts.
  • apps/ui/src/lib/telemetry/index.ts: remove the import { azureMonitorProvider } from "./providers/azure-monitor" line and its entry in the providers array. (Leave sentryProvider() if present.)

3. Strapi telemetry provider

  • Delete apps/strapi/src/telemetry/providers/azure-monitor.ts.
  • apps/strapi/src/telemetry/index.ts: remove the azureMonitorProvider import 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/ and apps/strapi/src/instrumentation.ts in 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/ and apps/strapi/src/instrumentation.ts, and remove the import "./instrumentation" line from apps/strapi/src/index.ts. Do NOT remove the logger.info("Strapi bootstrap …") calls or the import { logger } from "./utils/logging".

    Ask the user which they prefer if it is not obvious from context.

4. UI next.config

  • apps/ui/next.config.mjs: in serverExternalPackages, 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: remove APPLICATIONINSIGHTS_CONNECTION_STRING from the server schema block and runtimeEnv. Keep OTEL_SERVICE_NAME and LOG_LEVEL.
  • turbo.json globalEnv: remove APPLICATIONINSIGHTS_CONNECTION_STRING. Keep OTEL_SERVICE_NAME and LOG_LEVEL.
  • apps/ui/.env.local.example and apps/strapi/.env.example: remove the APPLICATIONINSIGHTS_CONNECTION_STRING line (and the "Azure Monitor … telemetry provider" comment). Keep the LOG_LEVEL and OTEL_SERVICE_NAME lines.

6. Docs

  • apps/docs/docs/reference/integrations/logging.md: delete the ## Azure Monitor / Application Insights section. 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 ./azure row 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 the APPLICATIONINSIGHTS_CONNECTION_STRING table row. Keep LOG_LEVEL and OTEL_SERVICE_NAME rows.

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_modules

Note: @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 refs

Confirm logging still works: @repo/logging still exports logger/logError/withSpan, @opentelemetry/api is still a dependency, and withSpan call sites still typecheck.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.