-
Notifications
You must be signed in to change notification settings - Fork 773
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
Add better documentation for IResourceDetector and OltpExporter configuration #4230
Add better documentation for IResourceDetector and OltpExporter configuration #4230
Conversation
@cromefire would you update the PR title please? (this PR is exposing new API, which is more than "add better documentation") |
Also added #4139 to the fixes list. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blocking temporarily to prevent accidental merges, as we are in the process of stable release. Will unblock once the release process is done.
…lbacks # Conflicts: # src/OpenTelemetry/.publicApi/net462/PublicAPI.Unshipped.txt # src/OpenTelemetry/.publicApi/net6.0/PublicAPI.Unshipped.txt # src/OpenTelemetry/.publicApi/netstandard2.0/PublicAPI.Unshipped.txt # src/OpenTelemetry/.publicApi/netstandard2.1/PublicAPI.Unshipped.txt
Made this into the PR for the documentation |
This PR was marked stale due to lack of activity and will be closed in 7 days. Commenting or Pushing will instruct the bot to automatically remove the label. This bot runs once per day. |
Just waiting for merge, bot |
This PR was marked stale due to lack of activity and will be closed in 7 days. Commenting or Pushing will instruct the bot to automatically remove the label. This bot runs once per day. |
Go away bot, still waiting for merge. |
public class MyResourceDetector : IResourceDetector | ||
{ | ||
public Resource Detect() | ||
{ | ||
return ResourceBuilder.CreateEmpty() | ||
.AddService("your service name") | ||
.Build(); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if we made this slightly more interesting by showing something being injected?
public class MyResourceDetector : IResourceDetector
{
private readonly IWebHostEnvironment webHostEnvironment;
public MyResourceDetector(IWebHostEnvironment webHostEnvironment)
{
this.webHostEnvironment = webHostEnvironment;
}
public Resource Detect()
{
return ResourceBuilder.CreateEmpty()
.AddService(serviceName: this.webHostEnvironment.ApplicationName)
.AddAttributes(new Dictionary<string, object> { ["host.environment"] = this.webHostEnvironment.EnvironmentName })
.Build();
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The environment is injected, I can add something else too if you want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cromefire I don't see any changes on the diff did you forget to push maybe? 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No I'm just too stupid to use the GitHub app... Will fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
… service-provider-callbacks
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fixes #4228.
Changes
IResourceDetector
For significant contributions please make sure you have completed the following items:
CHANGELOG.md
updated for non-trivial changes