-
Notifications
You must be signed in to change notification settings - Fork 16
refactor: add otel deployment env constant #124
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
Conversation
Codecov Report
@@ Coverage Diff @@
## main #124 +/- ##
=========================================
Coverage 69.79% 69.79%
Complexity 873 873
=========================================
Files 87 87
Lines 3615 3615
Branches 375 375
=========================================
Hits 2523 2523
Misses 946 946
Partials 146 146
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
This comment has been minimized.
This comment has been minimized.
No strong reasons, only that there were already a bunch of constants defined in enum classes https://github.com/hypertrace/hypertrace-ingester/tree/main/span-normalizer/span-normalizer-constants/src/main/java/org/hypertrace/core/span/normalizer/constants, so I just followed the pattern. Also the fact these constants are used in the platform directly, I felt following the existing pattern of defining constants would be better.
What kind of changes are you referring to?
Well the intention was to expose the constants only through these wrapper methods for the consumers. But, yeah right now it is only used in enrichers. #71 |
Beyond being easier to use, constants indicate that they should not be enumerated, and more importantly - they're inlined by the compiler. This means they could be used as compileOnly dependencies, rather than runtime. Not sure how much work that would be to switch, and likely not worth adding more confusion to the pile right now.
I was getting at the utils methods, but looks like you mentioned them below. I'm more interested in using them in view generators right now - we apply enrichment on some attributes, but others, we want to use as is - there's no logic to apply in enrichment and we just want it to go into the view. So in that case, is the view generator intended to use the util? the constant? something else? |
As I said earlier, I wanted the utils module to be used for these, but its artifact isn't being published. |
Based off of:
https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/deployment_environment.md
A few questions when looking in this code (@rish691 I think you have the most context):
.getValue()everywhere or just saving them into constants anyway likeprivate static final String OTEL_NET_PEER_IP = OTelSpanSemanticConventions.NET_PEER_IP.getValue();