Skip to content

Conversation

@overcut-ai
Copy link

@overcut-ai overcut-ai bot commented Jan 9, 2026

Summary

This PR adds a contributor-focused AGENTS.md with the essential information agents need when working in this repository.

Changes

  • Document the project overview, repository layout, and key source references
  • Outline the development workflow along with lint, test, and build expectations
  • Capture coding patterns, critical rules, common tasks, and supporting resources

Why

Keeping AGENTS.md up to date ensures anyone touching the repo can quickly align with current practices, tooling, and release processes.

Summary

This PR introduces a contributor-focused `AGENTS.md` that centralizes the project overview, repository layout, development workflow, and key references for working on `@amplication/opentelemetry-nestjs`. It captures the conventions, quality standards, and critical rules contributors must follow to keep tracing instrumentation, SDK helpers, and release processes aligned.

Changes

  • Documentation: Added a comprehensive `AGENTS.md` detailing the project overview, repository structure, automation workflows, code patterns, quality standards, critical rules, and common contributor tasks.
  • Documentation: Curated references to core source files, testing conventions, NodeSDK helpers, and CI/CD resources to guide agents through typical updates and releases.

Commits

Testing

  • Review `AGENTS.md` rendering in GitHub to ensure formatting, lists, and code blocks display correctly.
  • Verify all referenced paths, commands, and filenames in `AGENTS.md` match the current repository structure and tooling.

- summarize repo structure, workflows, coding patterns\n- highlight quality standards and critical rules for agents\n- add common tasks and reference materials
@overcut-ai
Copy link
Author

overcut-ai bot commented Jan 9, 2026

Completed Working on "Auto PR Description"

✅ Workflow completed successfully.


👉 View complete log

@overcut-ai
Copy link
Author

overcut-ai bot commented Jan 9, 2026

Completed Working on "Code Review"

✅ Workflow completed successfully.


👉 View complete log

Copy link
Author

@overcut-ai overcut-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Findings: 0 BLOCKER, 0 CRITICAL, 1 MAJOR, 0 MINOR, 0 SUGGESTION, 0 PRAISE.

Key theme:

  1. The new AGENTS.md entry for forRootAsync() documents a factory return shape ({ instrumentation?: Provider<Instrumentation>[] }) that the module does not actually consume; it currently iterates over the injected value directly, so following the doc leads to a runtime TypeError. The documentation needs to match the implementation (or vice versa).

Next steps:

  • Update AGENTS.md to describe the actual factory contract in OpenTelemetryModule.forRootAsync, or adjust the module to read .instrumentation before iterating.
  • Re-run a sample module using the documented factory to confirm the instructions work end-to-end.

];
```
`OpenTelemetryModule.forRoot()` registers these providers globally and eagerly calls `setupInstrumentation()` on each (plus `DecoratorInstrumentation`) via the `Constants.SDK_INJECTORS` factory. When supplying `config.instrumentation`, always pass providers extending the `Instrumentation` interface exported from `src/trace/instrumentation/Instrumentation`.
- **Async bootstrapping**: `forRootAsync()` uses `ModuleRef.create()` to instantiate `DecoratorInstrumentation` and any supplied instrumentation classes lazily; ensure async factories in `OpenTelemetryModuleAsyncOptions` return `{ instrumentation?: Provider<Instrumentation>[] }`.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[MAJOR]: AGENTS.md L55-L57 says forRootAsync() factories should return { instrumentation?: Provider<Instrumentation>[] }, but the module currently injects that value and iterates over it directly (see src/open-telemetry.module.ts L100-L111: it treats the injected value itself as the iterable instrumentation list and never dereferences .instrumentation). Following the doc therefore throws TypeError: instrumentation is not iterable whenever the documented object shape is returned. Update this section to describe the shape that actually works today or adjust the code before documenting the object contract.

Suggested fix: Document that the async factory must currently return the instrumentation array itself (or update the module to read .instrumentation before iterating) so readers do not follow a crashing example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants