Google Cloud console has feature to enable a debug trace session for apigee proxy to analyse the flow with the transaction map generated.
I am using Apigee emulator which shows supported feature for Debug trace. But not able to get any option with VS Code locally to start the debug session and get Transaction Map like Google Cloud Console. Please help/suggest with the possible option to perform Debug Session trace locally.
Yes, it is kind of a hidden feature isn't it?
This is how you enable it.
1. In bottom left side panel of VS Code you click on the Manage button (cog wheel), and then click Settings.
2. When the search box appears, type apigee.
3. You should see Cloudcode > Apigee: Docker Options. Click the Edit in settings.json
4. A JSON object will be displayed. You will add the following property to this JSON object
{
"cloudcode.duetAI.project": "yourorg",
"workbench.editorAssociations": {
"*.html": "default"
},
"editor.codeActionsOnSave": {
},
"cloudcode.apigee.gemini.enable":true,
"cloudcode.updateChannel": "trusted-testers",
"cloudcode.project": "yourorg",
"cloudcode.apigee.emulators": [
"1.12.0",
"google/apigee-emulator:1.9.1",
"gcr.io/apigee-release/hybrid/apigee-emulator:1.12.0"
],
"cloudcode.apigee.dockerOptions": {
"environmentVariables": {
"XTERM": "xterm-256color"
},
"dns": "8.8.8.8",
"detached": true,
"privileged": true,
"labels": {},
"volumes": {},
"additionalArguments": ""
}
}
So your edited JSON file will look like the one below. I added it as the last line below. Make sure to add a comma to the line above.
{
"cloudcode.duetAI.project": "yourorg",
"workbench.editorAssociations": {
"*.html": "default"
},
"editor.codeActionsOnSave": {
},
"cloudcode.apigee.gemini.enable":true,
"cloudcode.updateChannel": "trusted-testers",
"cloudcode.project": "yourorg",
"cloudcode.apigee.emulators": [
"1.12.0",
"google/apigee-emulator:1.9.1",
"gcr.io/apigee-release/hybrid/apigee-emulator:1.12.0"
],
"cloudcode.apigee.dockerOptions": {
"environmentVariables": {
"XTERM": "xterm-256color"
},
"dns": "8.8.8.8",
"detached": true,
"privileged": true,
"labels": {},
"volumes": {},
"additionalArguments": ""
},
"cloudcode.beta.enableApigeeTrace": true
}
5. Save the edited file and once you save it you will see the debug button next to the deployed proxy. Notice the Debug Play button next to my localemulator-reverse-proxy.
6. Click that Play button, send a request to your local proxy, and then you should see the following Trace Tab open. You can click on each line in the Stages section and the Stage details section will display the details.
Happy local debugging! What a joy!
Hello,
You just saved my day with this post. Thanks a lot.
Just a few question if you have time to respond.
Are the debug session results stored somewhere or are they just visible only in the editor?
The button is labelles "Start Tracing", no stop option. So my question is following : does the trace session ends like on the web interface after a given time or number of messages capture?
Thanks again for the setting.
Thanks, I see that this works, but sometimes they don't show up for some reason. When I try to spawn another trace, a lot of them suddenly appear all together. Is there a command to reset them all and start fresh?
@alirz thanks for following up with your experiences and question!
To help keep each topic focused and searchable for others in the community, we recommend opening a new thread for each specific issue. This way, your question gets more visibility and targeted help.
Feel free to link back to this thread for context. And thank you for contributing to the discussion!😊