Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 OpenTelemetry Sample #78
Add OpenTelemetry Sample #78
Changes from 3 commits
ae681fc
4022dd6
60c11c2
7e18c0c
03cf106
c0d43a9
29680b2
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
I think it'd be valuable here and in workflow to show a custom metric. E.g.
ActivityExecutionContext.Current.MetricMeter.CreateCounter<int>("my-counter").Add(123)
andWorkflow.MetricMeter.CreateCounter<int>("my-counter").Add(123)
. Technically you could instantiate the activity class with the .NET mertic meter, but this way respects the existing abstraction (so you don't have to have custom meter), and for workflows you can't inject anything and it's a replay-safe metric meter (i.e. it doesn't record on replay).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.
Added
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.
Hrmm, so there are two ways to configure OTel telemetry metrics. One way is this, but the other way is simply to set the OTel options in this metric options so our internal code forwards. We often encourage the latter because it's less setup and it matches other SDKs.
I wonder if there is some way we can show both? Like maybe switched from one to the other via CLI flag?
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.
I split this into two samples,
OpenTelemetry/CoreSdkFowarding
andOpenTelemetry/DotNetMetrics
.I thought this was cleanest, and follows a similar pattern that exists with the polling samples
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.
Ok, will look. Alternatively we probably could have just had a different parameter accepted in the
Program.cs
to choose one approach or the other instead of completely separate projects.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.
Is this file needed? We don't usually add to the rest of our samples
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.
Not needed, removed.
launchSettings are a convenience that popular .NET IDEs such as Rider, VS, and VSCode support that allow developers to pre-configure executables launched directly in the IDE with command line arguments, environment variables, etc
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.
I did see that the python samples are using the Jaeger image and not the Aspire Dashboard, which is developed by Microsoft: https://github.com/temporalio/samples-python/tree/main/open_telemetry
I can change to the Jaeger image if desired.
The main benefit of using the Aspire dashboard over Jaeger is that it provides visualizations for metrics, which iirc Jaeger does not. I think using a Microsoft image is probably okay specifically for .NET
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.
I don't mind this, I like the metrics, so I think this image is great. Alternatively, you can get rid of docker compose and just tell people how to start the this docker container directly in the README, but this is fine too.
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.
Imo, docker compose is easier with a single command, since environment variables and port forwarding are involved