google / google/slo-generator

💡 [REQUEST] - Document how to use Visual Studio Code launch configurations for debugging

Open
#306 2 comments 0 reactions 1 assignee Claimed by @lvaylet View on GitHub
docs documentation
Dominant language
Python
Stars
564
Forks
88
PR merge metrics
No merged PRs in 30d

Description

### Summary

Running and debugging the SLO Generator from Visual Studio Code can be confusing due to the fact that `slo-generator` is defined as a console script entrypoint in `setup.cfg`:

```
[options.entry_points]
console_scripts =
slo-generator = slo_generator.cli:main
```

Document how to run/debug a simple `slo-generator compute ...` command, for example in `CONTRIBUTING.md`.

### Basic Example

This sample `launch.json` can be used to run/debug a simple `slo-generator compute ...` call:

```json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "SLO Generator",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/venv/bin/slo-generator",
"args": [
"compute",
"--slo-config",
"samples/cloud_monitoring/slo_gae_app_availability.yaml",
"--config",
"samples/config.yaml"
],
"envFile": "${workspaceFolder}/.env",
"console": "integratedTerminal",
"justMyCode": true
}
]
}
```

Especially note the values of `program` (retrieved from `which slo-generator` after the package is installed in editable mode), `args` and `envFile`.

### Screenshots

```bash
![DESCRIPTION](LINK.png)
```

### Drawbacks

None identified.

### Unresolved questions

_No response_

### Code of Conduct

- [X] I agree to follow this project's Code of Conduct

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.