Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(crwa): OpenTelemetry in CRWA with a new TUI #8043

Merged
merged 14 commits into from
Apr 19, 2023
Merged

Conversation

Josh-Walker-GM
Copy link
Collaborator

DRAFT/WIP: I still have some things I want to change about this. The telemetry backend isn't permanent yet as such it is likely best to test with --telemetry false. Overall, I'm not certain we'll collectively think it's a good idea to go in this direction with a tui package.


Problem
We want to switch out to use OpenTelemetry in create-redwood-app and in doing so reduce create-redwood-app's dependency size.

Changes

  1. Redwood's own telemetry has been removed.
  2. OpenTelemetry added to create-redwood-app.
  3. Removed Listr2 from create-redwood-app and replaced it with @redwoodjs/tui.

Note on point 2
We currently use @opentelemetry/exporter-trace-otlp-http as the OpenTelemetry exporter but it's surprisingly heavy at around 5MB! We might want to try find an exporter with a smaller footprint. @opentelemetry/exporter-zipkin is around half the size but I'll need to do some research on this.

Note on point 3
The switch to OTel was started in #7455 but I was unhappy working around Listr2 when trying to instrument the code. Listr2 is also quite heavy at around 5MB. I went ahead and stripped it out and replaced it with a basic homebrewed TUI package - @redwoodjs/tui.

My thinking was we can reduce the size of the dependencies and have a little more control over the look and feel of the terminal experience. This may be over-engineering things a little but the tui package could also serve as a good way to keep styling consistent between crwa, cli and any cli plugins we enable in the future. I didn't think we needed a full task list rendering library like tasktree for create-redwood-app but we'll likely need that for the CLI - perhaps we can implement something similar or use such a lib. Happy to discuss concerns or objections around going in this direction!

@jtoar jtoar marked this pull request as ready for review April 19, 2023 19:28
@jtoar jtoar added the release:chore This PR is a chore (means nothing for users) label Apr 19, 2023
@replay-io
Copy link

replay-io bot commented Apr 19, 2023

16 replays were recorded for 0b4e4d7.

image 0 Failed
image 16 Passed
    requireAuth graphql checks
          ```
          locator.waitFor: Target closed
          =========================== logs ===========================
          waiting for locator('.rw-form-error-title').locator('text=You don\'t have permission to do that') to be visible
          ============================================================
          ```
        </ol>
      </details>
      <li><a href=https://app.replay.io/recording/3cb14e7c-0607-4b96-acd4-1561802404f8>useAuth hook, auth redirects checks</a></li>
      <li><a href=https://app.replay.io/recording/ac8ac7c7-783b-4f7d-9764-9ddb0d5e4679>Check that a specific blog post is prerendered</a></li>
      <li><a href=https://app.replay.io/recording/bc4d6b78-fe35-4813-8ea6-e132014181a3>Check that about is prerendered</a></li>
      <li><a href=https://app.replay.io/recording/83357629-f425-40e7-80d6-fc54fd3bc487>Check that homepage is prerendered</a></li>
      <li><a href=https://app.replay.io/recording/363087aa-3cfd-4a57-9922-fe2ea1c09ccd>Check that meta-tags are rendering the correct dynamic data</a></li>
      <li><a href=https://app.replay.io/recording/a241b8c0-591a-4ee8-a633-8b3bb514ccdc>Check that you can navigate from home page to specific blog post</a></li>
      <li><a href=https://app.replay.io/recording/f86e146e-4626-46a9-83a5-6a85c8d5e3cd>Waterfall prerendering (nested cells)</a></li>
      <li><a href=https://app.replay.io/recording/5cf2d673-8fb5-4155-9f7c-e84db0185222>RBAC: Admin user should be able to delete contacts</a></li>
      <li><a href=https://app.replay.io/recording/a15a0be6-9d44-4f1a-b811-e593309c06fc>RBAC: Should not be able to delete contact as non-admin user</a></li>
      <li><a href=https://app.replay.io/recording/a24bfcda-ab32-44ea-b2f9-e0c6e2b763f3>Smoke test with dev server</a></li>
      <li><a href=https://app.replay.io/recording/94c2d080-bdc0-48f7-90c5-541547462a36>Smoke test with rw serve</a></li>
      <li><a href=https://app.replay.io/recording/cadcb0f7-70f6-4073-b54e-97fc34fad044>Loads Cell mocks when Cell is nested in another story</a></li>
      <li><a href=https://app.replay.io/recording/21fd2a78-072b-484b-9740-c843158b693e>Loads Cell Stories</a></li>
      <li><a href=https://app.replay.io/recording/f6fd6ca0-22fd-40ce-b1ec-967f21d5382c>Loads MDX Stories</a></li>
      <li><a href=https://app.replay.io/recording/b524f2df-a916-4279-82da-8eb72506a7cd>Mocks current user, and updates UI while dev server is running</a></li>
      

View test run on Replay ↗︎

@Josh-Walker-GM Josh-Walker-GM merged commit 4c48615 into main Apr 19, 2023
@Josh-Walker-GM Josh-Walker-GM deleted the jgmw-tui branch April 19, 2023 20:56
@redwoodjs-bot redwoodjs-bot bot added this to the next-release milestone Apr 19, 2023
jtoar added a commit that referenced this pull request Apr 21, 2023
* mv @babel/node to devDeps

* remove reference to project-config

* remove unused devDeps
@jtoar jtoar modified the milestones: next-release, v5.0.0 Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:chore This PR is a chore (means nothing for users)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants