-
Notifications
You must be signed in to change notification settings - Fork 775
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 support for OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE environment variable #4667
Merged
utpilla
merged 9 commits into
open-telemetry:main
from
utpilla:utpilla/Add-support-for-Temporality-Preference
Jul 19, 2023
Merged
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
fcbe3a4
Update OTLPExporter extension method
utpilla f379d06
Add InitializationAction support in DelegatingOptionsFactory.
CodeBlanch 1146438
Merge remote-tracking branch 'origin/main' into utpilla/Add-support-f…
utpilla fcba290
Use a const string
utpilla 6663152
Merge remote-tracking branch 'origin/main' into utpilla/Add-support-f…
utpilla 1a2fa11
Add unit test
utpilla 21a2160
Code changes
utpilla 1b2eedc
Merge remote-tracking branch 'origin/main' into utpilla/Add-support-f…
utpilla 9d3f89a
Update CHANGELOG
utpilla File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
nit: Use the constant
OtlpMetricExporterExtensions.OtlpMetricExporterTemporalityPreferenceEnvVarKey
here (I'm assuming the tests can see internals)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.
This was done on purpose. If someone accidentally changes the environment variable key name in the
src
file, then our tests should complain about it. If I use theconst string
defined in thesrc
file then our tests would simply pass even when the value of the key is changed.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 necessarily disagree with your logic, but it does break with all other envvar tests that I can recall seeing. Ex:
opentelemetry-dotnet/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/OtlpExporterOptionsTests.cs
Lines 62 to 65 in e7f7cd6
I would probably go with the constant to be consistent and follow DRY principle. If someone does have a valid reason to change it they should only have to do it in one spot.
But I made this a "nit" comment because I figured you might disagree 🤣 Up to you!
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 we should think about what do we want to test? If we want to test, that a user a can configure something by providing a value for a particular string in the config, then our tests shouldn't be using the same const as the src file. Our tests would be too dynamic for their own good. 😄