Generic prompt (any stack)
Use this when your stack is not in the list below, or when you want the agent to detect the language and framework itself. Works well with Claude Code and Cursor; weaker agents may need a nudge.
You are helping me instrument my application with OpenTelemetry, sending telemetry to Telemtra (https://telemtra.io).
CONTEXT:
- Telemtra is OTLP-native. Endpoint: https://ingest.telemtra.io
- Authentication: x-api-key header
- Configuration is via standard OpenTelemetry environment variables — the SDK reads them automatically when initialized:
TELEMTRA_API_KEY=<my-key>
OTEL_EXPORTER_OTLP_ENDPOINT=https://ingest.telemtra.io
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
OTEL_EXPORTER_OTLP_HEADERS=x-api-key=${TELEMTRA_API_KEY}
OTEL_SERVICE_NAME=<auto-detect from project name>
OTEL_RESOURCE_ATTRIBUTES=deployment.environment=<auto-detect>
- All env vars live in my .env file.
GOAL:
1. Detect the primary language and framework (check package.json, Cargo.toml, pyproject.toml/requirements.txt, go.mod, *.csproj, pom.xml, build.gradle, Gemfile).
2. Install the OFFICIAL OpenTelemetry SDK + auto-instrumentation packages for that stack (no third-party reimplementations).
3. Add the env vars above to .env. For OTEL_SERVICE_NAME, use the project's package name. For deployment.environment, read from NODE_ENV / ENV / ENVIRONMENT / RAILS_ENV / ASPNETCORE_ENVIRONMENT (whichever is conventional for this stack); default to "development".
4. Initialize the SDK as early as possible in the entry point (before other modules in load-order-sensitive languages like Node/Python).
5. Ensure auto-instrumentation is enabled so HTTP/db/messaging calls are captured without manual span code.
CONSTRAINTS:
- Use OTLP HTTP (http/protobuf), not gRPC.
- If existing OpenTelemetry setup is detected, STOP and ask me before modifying it.
- Do not commit .env. Add it to .gitignore if not present.
- Do not inline the API key in source.
VERIFY:
After implementation, give me an exact command to start the app and a curl command to hit a known route (detect the port and an endpoint from the code). Run both, then open https://app.telemtra.io/overview — my service should appear within 60 seconds.