-
Notifications
You must be signed in to change notification settings - Fork 1
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
NH-64716 First steps to integrate oboe settings API #223
Conversation
c9f9a14
to
9aac496
Compare
logger.warning( | ||
"Could not import API in lambda mode. Installed layer version not compatible. Tracing disabled: %s", | ||
err, | ||
) | ||
return ( | ||
noop_extension, | ||
noop_extension.Context, | ||
noop_extension.OboeAPI, | ||
) |
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 is what happens if APM Python is built using c-lib < 14.0.0
@@ -143,43 +140,8 @@ def calculate_liboboe_decision( | |||
xtraceoptions: Optional[XTraceOptions] = None, | |||
) -> dict: | |||
"""Calculates oboe trace decision based on parent span context and APM config.""" | |||
tracestring = None |
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 main changes of this function are (1) moving the if
of the if-else
for lambda to the top and (2) actually using OboeAPI now.
This reverts commit 1034e69.
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.
Looks good but I had a question
"", | ||
0, | ||
) | ||
) = self.oboe_settings_api.getTracingDecision() |
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.
Do the arguments to this call not matter ? Actually curious if passing it the same thing as the non-lambda version vs passing it nothing makes any difference or if I should be doing it differently on my side of things
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.
Ah good question. Tried it now and yes, this method does not explode if passed all the same non-lambda args (though it's a drop decision). Works if no args at all of course.
It does error out if I try other combinations of args:Wrong number or type of arguments for overloaded function
Summary
ApmConfig.oboe_api
as c-lib OboeAPI if is_lambda and agent_enabled.Caveat
This works with c-lib 14 from staging i.e. 1034e69. If c-lib < 14 is used and
is_lambda
, agent will be disabled (see this message). Since I've reverted this commit, tox tests now fail. They last passed at 5069826 before the revert. Not sure if this is the correct way to proceed.Manual testing
Contents can be packaged into a usable lambda layer that, with custom otel-collector layer, can instrument a function and export metrics (example) and traces (example).
Contents work the same as before for locally-instrumented app to export traces and metrics by apm-proto.
Please see doc for more details: https://swicloud.atlassian.net/wiki/spaces/NIT/pages/3881501305/2023-11-16+OboeAPI+integration
Housekeeping notes
I am adding Configurator tests separately in https://swicloud.atlassian.net/browse/NH-67051
Not sure what else I could do to make the MeterManager tests more meaningful.
Awaiting further input regarding use of
sw.data.module
Still lots of stuff to do so I've added some Todos with tickies.
Please let me know what you think!