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 Tracing and rework cli so that the controller command does not start a FastAPI app #669
base: main
Are you sure you want to change the base?
Add Tracing and rework cli so that the controller command does not start a FastAPI app #669
Changes from all commits
e42c5c7
3c7f0a6
b9cb48c
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.
Does exporting default to
true
? Would I also have toexport OTLP_EXPORT_ENABLED=false
if I wanted to run blueapi from the command line?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, (assuming I understand the question), the default is false in the helm chart, dockerfile and here so you can just run BlueAPI and it wilkl not try to connect to Jaeger
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.
But if the env var is not set (like if running blueapi outside of a dev container), then it's treated like True?
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 it?
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.
As discussed offline, the code that interprest the Env Var (in core/init.py) is
OTLP_EXPORT_ENABLED = environ.get("OTLP_EXPORT_ENABLED") == "true"
and so will only enable export to Jaeger if the Env Var both exists and has been set to the string 'true'. This should however mean that there is no need to set this Env Var to 'false' as anything but 'true', including non-existance will result in the export being off, which is the desired default state. So I will remove the lines that explicitly do this.
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.
Should: Reconcile with #668 by @Relm-Arrowny
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 @callumforrester meant #663
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.
Will add Ray's arg name change into mine so that they are consistent.
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.
@callumforrester do you think we should have an extra launcher for when the config file is specified or just make it the default that one is requested - you would have to press return to specify non but I guess that's fine?
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'm quite happy with the extra launcher, I don't need to specify a config file 80% of the time, so having to press enter for no reason 80% of the time is actually mildly annoying. I realise it's only mildly but the "just one little extra step isn't too bad" mentality is a slippery slope that eventually leads to GDA.
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.
Updated so there is a custom config option or both the serve and controller commands
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 we have said Jaeger server?
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 it won't be available till next year
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.
Should: As discussed, we'd prefer not to set config in the Dockerfile and instead use the helm chart
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.
How does that work for the dev container though as it uses the dockerfile to initialise? The config is set in the helm chart too but that doesn't help in VSCode?
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.
For the devcontainer you should be editing
.devcontainer/devcontainer.json
, which configures the base image into a devcontainer, I think you need to add something that looks a bit like this: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.
As noted above, not setting the variable at all will result in Export being off, which is the desired default state, however the other vars are needed to configure tracing correctly, so that if export is enabled it can function. I guess therefore these should be moved into the devcontainer.json as you say, but where can I set them for a plain valnilla blueapi being run from the command line with no Dev Container or hekm chart involved?
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 at that point they should be passed in at container startup time
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.
We should, in general, update the docs to reflect this PR. I don't mind if you do that here or make a separate issue
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.
Add defaults in case these aren't set
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 uses this? It's not referenced in the helm chart
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.
It populates the env vars above?
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.
Could: This change seems unrelated to the PR, ideally it should be raised separately
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 linting thing did it not me
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.
(Probably) should: Rather than importing
app
into this module, you could just include this line instart()
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'm not sure waht the result of that would be, as you would be starting the FastAPI instrumentation inside an already instrymented method, but I can try and see what happens.