Skip to content

Conversation

sei-bstein
Copy link
Contributor

Adds a new ServiceDefaults library (currently entirely OTel-related).

This is extremely WIPish, it's just easier to get the package into the container if I can publish to nuget as I iterate. I know I need to solve this problem better longterm, it's just easier to get the package source into the container env if it's on NuGet for now.

To address a couple of likely questions:

  • Not worrying about default health checks or service discovery right now, but we can return to this as they become useful. The short-term goal is to package up easy writing to OTel.
  • (Optionally) Using Prometheus: - I was very hesitant to do this originally, but optionally using the Prometheus exporter is one of the easier ways to more generally publish a /metrics endpoint that scrapers like Prometheus can consume. I thought it might be useful in debugging as we get this up and rolling, to make sure we're writing the metrics we want to. I see this being off most of the time in practice except for specialized cases, or to check stuff out in dev.

I expect this will change/grow a lot even over the course of my initial implementation, but wanted to get something in there. Very much welcome your thoughts.

@sei-bstein sei-bstein self-assigned this Oct 6, 2025
@sei-bstein sei-bstein requested a review from a team as a code owner October 6, 2025 20:59
@sei-bstein sei-bstein added the enhancement New feature or request label Oct 6, 2025

if (env.IsDevelopment())
{
x.SetSampler<AlwaysOnSampler>();

Choose a reason for hiding this comment

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

Does this have performance impacts in dev? Should it be optional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought about this, yeah. This is for sure not a thing you want to do in production, according to multiple sources, but most examples have it on in dev. I don't mind parameterizing it like we do the other config. I'll add this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants