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

Documentation about using Aspire dashboard with browser telemetry #1588

Closed
JamesNK opened this issue Sep 2, 2024 · 12 comments · Fixed by #1616 or #1701
Closed

Documentation about using Aspire dashboard with browser telemetry #1588

JamesNK opened this issue Sep 2, 2024 · 12 comments · Fixed by #1616 or #1701
Assignees
Labels
dashboard doc-enhancement Improve the current content [org][type][category] documentation Improvements or additions to documentation dotnet-aspire/prod in-pr okr-freshness OKR: Freshness of content Pri1 High priority, do before Pri2 and Pri3 📌 seQUESTered Identifies that an issue has been imported into Quest.

Comments

@JamesNK
Copy link
Member

JamesNK commented Sep 2, 2024

See dotnet/aspire#4917

  • Documentation should discuss enabling OTLP HTTP endpoint
  • Discuss CORS. Aspire should enable automatically but it should be mentioned that has happened so folks know they'll need to think about it if deploying their app with telemetry enabled
  • Briefly discuss setting up OTEL in a browser app (should mostly point to existing OTEL docs)
  • Link to sample app if available - Add sample that send telemetry from the browser aspire-samples#409

Associated WorkItem - 308083

@dotnet-bot dotnet-bot added the ⌚ Not Triaged Not triaged label Sep 2, 2024
@IEvangelist IEvangelist self-assigned this Sep 3, 2024
@IEvangelist IEvangelist added documentation Improvements or additions to documentation 🗺️ reQUEST Triggers an issue to be imported into Quest. Pri1 High priority, do before Pri2 and Pri3 doc-enhancement Improve the current content [org][type][category] dotnet-aspire/prod dashboard okr-freshness OKR: Freshness of content labels Sep 4, 2024
@dotnet-bot dotnet-bot removed the ⌚ Not Triaged Not triaged label Sep 4, 2024
@sequestor sequestor bot added 📌 seQUESTered Identifies that an issue has been imported into Quest. and removed 🗺️ reQUEST Triggers an issue to be imported into Quest. labels Sep 4, 2024
@aaronpowell
Copy link
Contributor

Let's time this with #1585

@JamesNK
Copy link
Member Author

JamesNK commented Sep 6, 2024

@IEvangelist Where would this content go?

Something to keep in mind that people could want to gather browser telemetry from an app that is integrated into an Aspire solution, in which case they need to enable the OTLP HTTP endpoint, like so: https://github.com/dotnet/aspire/blob/9a59d122949de428321599c503da59c54fb673d6/playground/BrowserTelemetry/BrowserTelemetry.AppHost/Properties/launchSettings.json#L12

Or they have the standalone dashboard, and want to collect browser telemetry. In that case they need to set configuration when launching the container to expose the OTLP port, and to enable CORS.

@aaronpowell
Copy link
Contributor

With #1585 I'm intending that we cover how to use the browser OpenTelemetry npm packages to push to the Aspire dashboard (already have that sample ready).

For general configuration, I'd think that we want the content to land here: https://learn.microsoft.com/en-gb/dotnet/aspire/fundamentals/dashboard/standalone?tabs=bash

@JamesNK
Copy link
Member Author

JamesNK commented Sep 6, 2024

Ideally:

Issue for adding app host configuration page: #1602

@IEvangelist
Copy link
Member

Ideally:

Issue for adding app host configuration page: #1602

Agree on all fronts, and I commented on #1602 - we have content for launch profiles already.

@JamesNK
Copy link
Member Author

JamesNK commented Sep 13, 2024

I don't feel this is done. How do I as an Aspire user know that I can configure Aspire to receive browser telemetry? Low level configuration is good to link to, but it isn't a good way for people to discover this capability.

Todo:

  • Documentation that says you can do this
  • Documentation about app host configuration

@JamesNK JamesNK reopened this Sep 13, 2024
@github-project-automation github-project-automation bot moved this from ✅ Done to 🏗 In progress in dotnet/docs September 2024 Sprint Sep 13, 2024
@IEvangelist
Copy link
Member

IEvangelist commented Sep 27, 2024

I just realized that this was re-opened, sorry I didn't notice sooner @JamesNK. I need a bit of clarification on these asks.

Documentation about app host configuration

Isn't that what the CORS config section speaks too? If not, what am I missing. I looked through the linked PR in dotnet/aspire and didn't see anything that stood out.

As for this:

Documentation that says you can do this

I can add something in the overview, if you're good with that?

@JamesNK
Copy link
Member Author

JamesNK commented Sep 28, 2024

Documentation about app host configuration

Isn't that what the CORS config section speaks too? If not, what am I missing. I looked through the linked PR in dotnet/aspire and didn't see anything that stood out.

No. That doc is for configuring the dashboard. Configuration for the app host is different. It comes from setting env vars in launchSettings.json. Note that some settings in the app host flow through the dashboard which is why it could seem like there is one thing, but they are different.

I can add something in the overview, if you're good with that?

I think there should be a section at https://learn.microsoft.com/en-us/dotnet/aspire/fundamentals/telemetry that discusses collecting browser telemetry.

It would talk through configuring OTLP HTTP endpoint, CORS, reading info from env vars for sending to the right location.

@IEvangelist
Copy link
Member

Awesome, thank you - that's the context I was missing.

@veldfolds
Copy link

i think i may need that section like now, please

@dotnetrepoman dotnetrepoman bot added 🗺️ mapQUEST Only used as a way to mark an issue as updated. RepoMan should instantly remove it. and removed 🗺️ mapQUEST Only used as a way to mark an issue as updated. RepoMan should instantly remove it. labels Oct 1, 2024
@dotnetrepoman dotnetrepoman bot added 🗺️ mapQUEST Only used as a way to mark an issue as updated. RepoMan should instantly remove it. and removed 🗺️ mapQUEST Only used as a way to mark an issue as updated. RepoMan should instantly remove it. labels Oct 3, 2024
@DGAISmith
Copy link

A quick question for clarity on my end (prior to the doc additions being proposed above). Is it accurate to say:

  1. The CORS configuration section (oltp-cors) only applies when running the dashboard in standalone mode.
  2. When running via AppHost, the Dashboard CORS configuration is populated automatically using the endpoints of each resource defined in the AppHost (added via this pull request - 5212).
  3. Considering the two points above - if I have a node app which is internally configured to use a custom domain (www.my-fancy-app.co.uk, manually added to hosts file and self-signed cert added locally) - I'm unable to use CORS config in point 1 when running the AppHost, and because Aspire will use localhost:[RandomPort] when starting the npm app up (and no way to ask AppHost to use a custom domain), I will always get a CORS error when the npm app attempts to transmit telemetry to the dashboard otlp endpoint?

In short - is there a way to wildcard CORS for the dashboard when running via AppHost?

@IEvangelist
Copy link
Member

That's a good question for @JamesNK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dashboard doc-enhancement Improve the current content [org][type][category] documentation Improvements or additions to documentation dotnet-aspire/prod in-pr okr-freshness OKR: Freshness of content Pri1 High priority, do before Pri2 and Pri3 📌 seQUESTered Identifies that an issue has been imported into Quest.
Projects
No open projects
Status: ✅ Done
Status: Slipped
6 participants