Skip to content
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

Tempo tracing #20

Open
wants to merge 82 commits into
base: main
Choose a base branch
from
Open

Tempo tracing #20

wants to merge 82 commits into from

Conversation

alithethird
Copy link
Contributor

@alithethird alithethird commented Dec 16, 2024

Overview

Adds new integration Tempo to the charm. Creates a class called TempoParameters that handles the parameters. There are only 2 parameters:

  • Endpoint
  • Service name

Endpoint comes from the integration and service name is generated by reading the charm name from the charmcraft.yaml file.

Rationale

Juju Events Changes

Module Changes

Library Changes

Checklist

@canonical canonical deleted a comment from github-actions bot Dec 18, 2024
@alithethird alithethird marked this pull request as ready for review December 18, 2024 08:00
@alithethird alithethird requested a review from a team as a code owner December 18, 2024 08:00
src/paas_charm/app.py Outdated Show resolved Hide resolved
src/paas_charm/charm.py Outdated Show resolved Hide resolved
src/paas_charm/charm.py Outdated Show resolved Hide resolved
src/paas_charm/charm.py Outdated Show resolved Hide resolved
src/paas_charm/charm.py Outdated Show resolved Hide resolved
src/paas_charm/charm_state.py Outdated Show resolved Hide resolved
src/paas_charm/charm_state.py Outdated Show resolved Hide resolved
src/paas_charm/charm_state.py Outdated Show resolved Hide resolved
src/paas_charm/charm_state.py Outdated Show resolved Hide resolved
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

license-eye has checked 264 files.

Valid Invalid Ignored Fixed
0 148 116 0
Click to see the invalid file list
  • examples/django/charm/charmcraft.yaml
  • examples/django/charm/src/charm.py
  • examples/django/django_app/django_app/django_app/init.py
  • examples/django/django_app/django_app/django_app/asgi.py
  • examples/django/django_app/django_app/django_app/settings.py
  • examples/django/django_app/django_app/django_app/urls.py
  • examples/django/django_app/django_app/django_app/wsgi.py
  • examples/django/django_app/django_app/manage.py
  • examples/django/django_app/django_app/migrate.sh
  • examples/django/django_app/django_app/testing/init.py
  • examples/django/django_app/django_app/testing/admin.py
  • examples/django/django_app/django_app/testing/apps.py
  • examples/django/django_app/django_app/testing/migrations/init.py
  • examples/django/django_app/django_app/testing/models.py
  • examples/django/django_app/django_app/testing/tests.py
  • examples/django/django_app/django_app/testing/views.py
  • examples/django/django_app/rockcraft.yaml
  • examples/django/django_async_app/django_async_app/django_async_app/init.py
  • examples/django/django_async_app/django_async_app/django_async_app/asgi.py
  • examples/django/django_async_app/django_async_app/django_async_app/settings.py
  • examples/django/django_async_app/django_async_app/django_async_app/urls.py
  • examples/django/django_async_app/django_async_app/django_async_app/wsgi.py
  • examples/django/django_async_app/django_async_app/manage.py
  • examples/django/django_async_app/django_async_app/testing/init.py
  • examples/django/django_async_app/django_async_app/testing/admin.py
  • examples/django/django_async_app/django_async_app/testing/apps.py
  • examples/django/django_async_app/django_async_app/testing/migrations/init.py
  • examples/django/django_async_app/django_async_app/testing/models.py
  • examples/django/django_async_app/django_async_app/testing/tests.py
  • examples/django/django_async_app/django_async_app/testing/views.py
  • examples/django/django_async_app/rockcraft.yaml
  • examples/fastapi/alembic.ini
  • examples/fastapi/alembic/env.py
  • examples/fastapi/alembic/versions/eca6177bd16a_initial_migration.py
  • examples/fastapi/app.py
  • examples/fastapi/charm/charmcraft.yaml
  • examples/fastapi/charm/src/charm.py
  • examples/fastapi/migrate.sh
  • examples/fastapi/rockcraft.yaml
  • examples/flask/charmcraft.yaml
  • examples/flask/src/charm.py
  • examples/flask/test_async_rock/app.py
  • examples/flask/test_async_rock/rockcraft.yaml
  • examples/flask/test_db_rock/alembic.ini
  • examples/flask/test_db_rock/alembic/env.py
  • examples/flask/test_db_rock/alembic/versions/eca6177bd16a_initial_migration.py
  • examples/flask/test_db_rock/app.py
  • examples/flask/test_db_rock/migrate.sh
  • examples/flask/test_db_rock/rockcraft.yaml
  • examples/flask/test_rock/app.py
  • examples/flask/test_rock/rockcraft.yaml
  • examples/go/charm/charmcraft.yaml
  • examples/go/charm/src/charm.py
  • examples/go/go.mod
  • examples/go/internal/service/service.go
  • examples/go/main.go
  • examples/go/migrate.sh
  • examples/go/rockcraft.yaml
  • localstack-installation.sh
  • pyproject.toml
  • setup.py
  • src/paas_app_charmer/init.py
  • src/paas_app_charmer/django/init.py
  • src/paas_app_charmer/django/charm.py
  • src/paas_app_charmer/fastapi/init.py
  • src/paas_app_charmer/fastapi/charm.py
  • src/paas_app_charmer/flask/init.py
  • src/paas_app_charmer/flask/charm.py
  • src/paas_app_charmer/go/init.py
  • src/paas_app_charmer/go/charm.py
  • src/paas_charm/init.py
  • src/paas_charm/_gunicorn/init.py
  • src/paas_charm/_gunicorn/charm.py
  • src/paas_charm/_gunicorn/webserver.py
  • src/paas_charm/_gunicorn/workload_config.py
  • src/paas_charm/_gunicorn/wsgi_app.py
  • src/paas_charm/app.py
  • src/paas_charm/charm.py
  • src/paas_charm/charm_state.py
  • src/paas_charm/charm_utils.py
  • src/paas_charm/database_migration.py
  • src/paas_charm/databases.py
  • src/paas_charm/django/init.py
  • src/paas_charm/django/charm.py
  • src/paas_charm/exceptions.py
  • src/paas_charm/fastapi/init.py
  • src/paas_charm/fastapi/charm.py
  • src/paas_charm/flask/init.py
  • src/paas_charm/flask/charm.py
  • src/paas_charm/framework.py
  • src/paas_charm/go/init.py
  • src/paas_charm/go/charm.py
  • src/paas_charm/observability.py
  • src/paas_charm/rabbitmq.py
  • src/paas_charm/secret_storage.py
  • src/paas_charm/utils.py
  • tests/init.py
  • tests/conftest.py
  • tests/integration/conftest.py
  • tests/integration/django/init.py
  • tests/integration/django/conftest.py
  • tests/integration/django/test_django.py
  • tests/integration/django/test_django_integrations.py
  • tests/integration/django/test_workers.py
  • tests/integration/fastapi/init.py
  • tests/integration/fastapi/conftest.py
  • tests/integration/fastapi/test_fastapi.py
  • tests/integration/flask/init.py
  • tests/integration/flask/conftest.py
  • tests/integration/flask/test_charm.py
  • tests/integration/flask/test_cos.py
  • tests/integration/flask/test_database.py
  • tests/integration/flask/test_db_migration.py
  • tests/integration/flask/test_integrations.py
  • tests/integration/flask/test_proxy.py
  • tests/integration/flask/test_workers.py
  • tests/integration/go/init.py
  • tests/integration/go/conftest.py
  • tests/integration/go/test_go.py
  • tests/integration/helpers.py
  • tests/unit/init.py
  • tests/unit/django/init.py
  • tests/unit/django/conftest.py
  • tests/unit/django/constants.py
  • tests/unit/django/test_charm.py
  • tests/unit/django/test_workers.py
  • tests/unit/fastapi/init.py
  • tests/unit/fastapi/conftest.py
  • tests/unit/fastapi/constants.py
  • tests/unit/fastapi/test_charm.py
  • tests/unit/flask/init.py
  • tests/unit/flask/conftest.py
  • tests/unit/flask/constants.py
  • tests/unit/flask/test_charm.py
  • tests/unit/flask/test_charm_state.py
  • tests/unit/flask/test_database_migration.py
  • tests/unit/flask/test_databases.py
  • tests/unit/flask/test_flask_app.py
  • tests/unit/flask/test_tracing.py
  • tests/unit/flask/test_webserver.py
  • tests/unit/flask/test_workers.py
  • tests/unit/go/init.py
  • tests/unit/go/conftest.py
  • tests/unit/go/constants.py
  • tests/unit/go/test_app.py
  • tests/unit/go/test_charm.py
  • tests/unit/test_deprecated.py
  • tox.ini
Use this command to fix any missing license headers
```bash

docker run -it --rm -v $(pwd):/github/workspace apache/skywalking-eyes header fix

</details>

@canonical canonical deleted a comment from github-actions bot Jan 6, 2025
@canonical canonical deleted a comment from github-actions bot Jan 6, 2025
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

license-eye has checked 264 files.

Valid Invalid Ignored Fixed
0 148 116 0
Click to see the invalid file list
  • examples/django/charm/charmcraft.yaml
  • examples/django/charm/src/charm.py
  • examples/django/django_app/django_app/django_app/init.py
  • examples/django/django_app/django_app/django_app/asgi.py
  • examples/django/django_app/django_app/django_app/settings.py
  • examples/django/django_app/django_app/django_app/urls.py
  • examples/django/django_app/django_app/django_app/wsgi.py
  • examples/django/django_app/django_app/manage.py
  • examples/django/django_app/django_app/migrate.sh
  • examples/django/django_app/django_app/testing/init.py
  • examples/django/django_app/django_app/testing/admin.py
  • examples/django/django_app/django_app/testing/apps.py
  • examples/django/django_app/django_app/testing/migrations/init.py
  • examples/django/django_app/django_app/testing/models.py
  • examples/django/django_app/django_app/testing/tests.py
  • examples/django/django_app/django_app/testing/views.py
  • examples/django/django_app/rockcraft.yaml
  • examples/django/django_async_app/django_async_app/django_async_app/init.py
  • examples/django/django_async_app/django_async_app/django_async_app/asgi.py
  • examples/django/django_async_app/django_async_app/django_async_app/settings.py
  • examples/django/django_async_app/django_async_app/django_async_app/urls.py
  • examples/django/django_async_app/django_async_app/django_async_app/wsgi.py
  • examples/django/django_async_app/django_async_app/manage.py
  • examples/django/django_async_app/django_async_app/testing/init.py
  • examples/django/django_async_app/django_async_app/testing/admin.py
  • examples/django/django_async_app/django_async_app/testing/apps.py
  • examples/django/django_async_app/django_async_app/testing/migrations/init.py
  • examples/django/django_async_app/django_async_app/testing/models.py
  • examples/django/django_async_app/django_async_app/testing/tests.py
  • examples/django/django_async_app/django_async_app/testing/views.py
  • examples/django/django_async_app/rockcraft.yaml
  • examples/fastapi/alembic.ini
  • examples/fastapi/alembic/env.py
  • examples/fastapi/alembic/versions/eca6177bd16a_initial_migration.py
  • examples/fastapi/app.py
  • examples/fastapi/charm/charmcraft.yaml
  • examples/fastapi/charm/src/charm.py
  • examples/fastapi/migrate.sh
  • examples/fastapi/rockcraft.yaml
  • examples/flask/charmcraft.yaml
  • examples/flask/src/charm.py
  • examples/flask/test_async_rock/app.py
  • examples/flask/test_async_rock/rockcraft.yaml
  • examples/flask/test_db_rock/alembic.ini
  • examples/flask/test_db_rock/alembic/env.py
  • examples/flask/test_db_rock/alembic/versions/eca6177bd16a_initial_migration.py
  • examples/flask/test_db_rock/app.py
  • examples/flask/test_db_rock/migrate.sh
  • examples/flask/test_db_rock/rockcraft.yaml
  • examples/flask/test_rock/app.py
  • examples/flask/test_rock/rockcraft.yaml
  • examples/go/charm/charmcraft.yaml
  • examples/go/charm/src/charm.py
  • examples/go/go.mod
  • examples/go/internal/service/service.go
  • examples/go/main.go
  • examples/go/migrate.sh
  • examples/go/rockcraft.yaml
  • localstack-installation.sh
  • pyproject.toml
  • setup.py
  • src/paas_app_charmer/init.py
  • src/paas_app_charmer/django/init.py
  • src/paas_app_charmer/django/charm.py
  • src/paas_app_charmer/fastapi/init.py
  • src/paas_app_charmer/fastapi/charm.py
  • src/paas_app_charmer/flask/init.py
  • src/paas_app_charmer/flask/charm.py
  • src/paas_app_charmer/go/init.py
  • src/paas_app_charmer/go/charm.py
  • src/paas_charm/init.py
  • src/paas_charm/_gunicorn/init.py
  • src/paas_charm/_gunicorn/charm.py
  • src/paas_charm/_gunicorn/webserver.py
  • src/paas_charm/_gunicorn/workload_config.py
  • src/paas_charm/_gunicorn/wsgi_app.py
  • src/paas_charm/app.py
  • src/paas_charm/charm.py
  • src/paas_charm/charm_state.py
  • src/paas_charm/charm_utils.py
  • src/paas_charm/database_migration.py
  • src/paas_charm/databases.py
  • src/paas_charm/django/init.py
  • src/paas_charm/django/charm.py
  • src/paas_charm/exceptions.py
  • src/paas_charm/fastapi/init.py
  • src/paas_charm/fastapi/charm.py
  • src/paas_charm/flask/init.py
  • src/paas_charm/flask/charm.py
  • src/paas_charm/framework.py
  • src/paas_charm/go/init.py
  • src/paas_charm/go/charm.py
  • src/paas_charm/observability.py
  • src/paas_charm/rabbitmq.py
  • src/paas_charm/secret_storage.py
  • src/paas_charm/utils.py
  • tests/init.py
  • tests/conftest.py
  • tests/integration/conftest.py
  • tests/integration/django/init.py
  • tests/integration/django/conftest.py
  • tests/integration/django/test_django.py
  • tests/integration/django/test_django_integrations.py
  • tests/integration/django/test_workers.py
  • tests/integration/fastapi/init.py
  • tests/integration/fastapi/conftest.py
  • tests/integration/fastapi/test_fastapi.py
  • tests/integration/flask/init.py
  • tests/integration/flask/conftest.py
  • tests/integration/flask/test_charm.py
  • tests/integration/flask/test_cos.py
  • tests/integration/flask/test_database.py
  • tests/integration/flask/test_db_migration.py
  • tests/integration/flask/test_integrations.py
  • tests/integration/flask/test_proxy.py
  • tests/integration/flask/test_workers.py
  • tests/integration/go/init.py
  • tests/integration/go/conftest.py
  • tests/integration/go/test_go.py
  • tests/integration/helpers.py
  • tests/unit/init.py
  • tests/unit/django/init.py
  • tests/unit/django/conftest.py
  • tests/unit/django/constants.py
  • tests/unit/django/test_charm.py
  • tests/unit/django/test_workers.py
  • tests/unit/fastapi/init.py
  • tests/unit/fastapi/conftest.py
  • tests/unit/fastapi/constants.py
  • tests/unit/fastapi/test_charm.py
  • tests/unit/flask/init.py
  • tests/unit/flask/conftest.py
  • tests/unit/flask/constants.py
  • tests/unit/flask/test_charm.py
  • tests/unit/flask/test_charm_state.py
  • tests/unit/flask/test_database_migration.py
  • tests/unit/flask/test_databases.py
  • tests/unit/flask/test_flask_app.py
  • tests/unit/flask/test_tracing.py
  • tests/unit/flask/test_webserver.py
  • tests/unit/flask/test_workers.py
  • tests/unit/go/init.py
  • tests/unit/go/conftest.py
  • tests/unit/go/constants.py
  • tests/unit/go/test_app.py
  • tests/unit/go/test_charm.py
  • tests/unit/test_deprecated.py
  • tox.ini
Use this command to fix any missing license headers
```bash

docker run -it --rm -v $(pwd):/github/workspace apache/skywalking-eyes header fix

</details>

@canonical canonical deleted a comment from github-actions bot Jan 8, 2025
@canonical canonical deleted a comment from github-actions bot Jan 8, 2025
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

license-eye has checked 300 files.

Valid Invalid Ignored Fixed
0 177 123 0
Click to see the invalid file list
  • app.py
  • examples/django/charm/charmcraft.yaml
  • examples/django/charm/src/charm.py
  • examples/django/django_app/django_app/django_app/init.py
  • examples/django/django_app/django_app/django_app/asgi.py
  • examples/django/django_app/django_app/django_app/settings.py
  • examples/django/django_app/django_app/django_app/urls.py
  • examples/django/django_app/django_app/django_app/wsgi.py
  • examples/django/django_app/django_app/manage.py
  • examples/django/django_app/django_app/migrate.sh
  • examples/django/django_app/django_app/testing/init.py
  • examples/django/django_app/django_app/testing/admin.py
  • examples/django/django_app/django_app/testing/apps.py
  • examples/django/django_app/django_app/testing/migrations/init.py
  • examples/django/django_app/django_app/testing/models.py
  • examples/django/django_app/django_app/testing/tests.py
  • examples/django/django_app/django_app/testing/views.py
  • examples/django/django_app/rockcraft.yaml
  • examples/django/django_async_app/django_async_app/django_async_app/init.py
  • examples/django/django_async_app/django_async_app/django_async_app/asgi.py
  • examples/django/django_async_app/django_async_app/django_async_app/settings.py
  • examples/django/django_async_app/django_async_app/django_async_app/urls.py
  • examples/django/django_async_app/django_async_app/django_async_app/wsgi.py
  • examples/django/django_async_app/django_async_app/manage.py
  • examples/django/django_async_app/django_async_app/testing/init.py
  • examples/django/django_async_app/django_async_app/testing/admin.py
  • examples/django/django_async_app/django_async_app/testing/apps.py
  • examples/django/django_async_app/django_async_app/testing/migrations/init.py
  • examples/django/django_async_app/django_async_app/testing/models.py
  • examples/django/django_async_app/django_async_app/testing/tests.py
  • examples/django/django_async_app/django_async_app/testing/views.py
  • examples/django/django_async_app/rockcraft.yaml
  • examples/django/django_tracing_app/django_tracing_app/django_tracing_app/init.py
  • examples/django/django_tracing_app/django_tracing_app/django_tracing_app/asgi.py
  • examples/django/django_tracing_app/django_tracing_app/django_tracing_app/settings.py
  • examples/django/django_tracing_app/django_tracing_app/django_tracing_app/urls.py
  • examples/django/django_tracing_app/django_tracing_app/django_tracing_app/wsgi.py
  • examples/django/django_tracing_app/django_tracing_app/manage.py
  • examples/django/django_tracing_app/django_tracing_app/migrate.sh
  • examples/django/django_tracing_app/django_tracing_app/testing/init.py
  • examples/django/django_tracing_app/django_tracing_app/testing/admin.py
  • examples/django/django_tracing_app/django_tracing_app/testing/apps.py
  • examples/django/django_tracing_app/django_tracing_app/testing/migrations/init.py
  • examples/django/django_tracing_app/django_tracing_app/testing/models.py
  • examples/django/django_tracing_app/django_tracing_app/testing/tests.py
  • examples/django/django_tracing_app/django_tracing_app/testing/views.py
  • examples/django/django_tracing_app/rockcraft.yaml
  • examples/fastapi/charm/charmcraft.yaml
  • examples/fastapi/charm/src/charm.py
  • examples/fastapi/fastapi_app/alembic.ini
  • examples/fastapi/fastapi_app/alembic/env.py
  • examples/fastapi/fastapi_app/alembic/versions/eca6177bd16a_initial_migration.py
  • examples/fastapi/fastapi_app/app.py
  • examples/fastapi/fastapi_app/migrate.sh
  • examples/fastapi/fastapi_app/rockcraft.yaml
  • examples/fastapi/fastapi_tracing_app/alembic.ini
  • examples/fastapi/fastapi_tracing_app/alembic/env.py
  • examples/fastapi/fastapi_tracing_app/alembic/versions/eca6177bd16a_initial_migration.py
  • examples/fastapi/fastapi_tracing_app/app.py
  • examples/fastapi/fastapi_tracing_app/migrate.sh
  • examples/fastapi/fastapi_tracing_app/rockcraft.yaml
  • examples/flask/charmcraft.yaml
  • examples/flask/src/charm.py
  • examples/flask/test_async_rock/app.py
  • examples/flask/test_async_rock/rockcraft.yaml
  • examples/flask/test_db_rock/alembic.ini
  • examples/flask/test_db_rock/alembic/env.py
  • examples/flask/test_db_rock/alembic/versions/eca6177bd16a_initial_migration.py
  • examples/flask/test_db_rock/app.py
  • examples/flask/test_db_rock/migrate.sh
  • examples/flask/test_db_rock/rockcraft.yaml
  • examples/flask/test_rock/app.py
  • examples/flask/test_rock/rockcraft.yaml
  • examples/flask/test_tracing_rock/app.py
  • examples/flask/test_tracing_rock/rockcraft.yaml
  • examples/go/charm/charmcraft.yaml
  • examples/go/charm/src/charm.py
  • examples/go/go_app/go.mod
  • examples/go/go_app/internal/service/service.go
  • examples/go/go_app/main.go
  • examples/go/go_app/migrate.sh
  • examples/go/go_app/rockcraft.yaml
  • examples/go/go_tracing_app/go.mod
  • examples/go/go_tracing_app/internal/service/service.go
  • examples/go/go_tracing_app/main.go
  • examples/go/go_tracing_app/migrate.sh
  • examples/go/go_tracing_app/rockcraft.yaml
  • localstack-installation.sh
  • pyproject.toml
  • setup.py
  • src/paas_app_charmer/init.py
  • src/paas_app_charmer/django/init.py
  • src/paas_app_charmer/django/charm.py
  • src/paas_app_charmer/fastapi/init.py
  • src/paas_app_charmer/fastapi/charm.py
  • src/paas_app_charmer/flask/init.py
  • src/paas_app_charmer/flask/charm.py
  • src/paas_app_charmer/go/init.py
  • src/paas_app_charmer/go/charm.py
  • src/paas_charm/init.py
  • src/paas_charm/_gunicorn/init.py
  • src/paas_charm/_gunicorn/charm.py
  • src/paas_charm/_gunicorn/webserver.py
  • src/paas_charm/_gunicorn/workload_config.py
  • src/paas_charm/_gunicorn/wsgi_app.py
  • src/paas_charm/app.py
  • src/paas_charm/charm.py
  • src/paas_charm/charm_state.py
  • src/paas_charm/charm_utils.py
  • src/paas_charm/database_migration.py
  • src/paas_charm/databases.py
  • src/paas_charm/django/init.py
  • src/paas_charm/django/charm.py
  • src/paas_charm/exceptions.py
  • src/paas_charm/fastapi/init.py
  • src/paas_charm/fastapi/charm.py
  • src/paas_charm/flask/init.py
  • src/paas_charm/flask/charm.py
  • src/paas_charm/framework.py
  • src/paas_charm/go/init.py
  • src/paas_charm/go/charm.py
  • src/paas_charm/observability.py
  • src/paas_charm/rabbitmq.py
  • src/paas_charm/secret_storage.py
  • src/paas_charm/utils.py
  • tests/init.py
  • tests/conftest.py
  • tests/integration/conftest.py
  • tests/integration/django/init.py
  • tests/integration/django/conftest.py
  • tests/integration/django/test_django.py
  • tests/integration/django/test_django_integrations.py
  • tests/integration/django/test_workers.py
  • tests/integration/fastapi/init.py
  • tests/integration/fastapi/conftest.py
  • tests/integration/fastapi/test_fastapi.py
  • tests/integration/flask/init.py
  • tests/integration/flask/conftest.py
  • tests/integration/flask/test_charm.py
  • tests/integration/flask/test_cos.py
  • tests/integration/flask/test_database.py
  • tests/integration/flask/test_db_migration.py
  • tests/integration/flask/test_integrations.py
  • tests/integration/flask/test_proxy.py
  • tests/integration/flask/test_workers.py
  • tests/integration/go/init.py
  • tests/integration/go/conftest.py
  • tests/integration/go/test_go.py
  • tests/integration/helpers.py
  • tests/unit/init.py
  • tests/unit/django/init.py
  • tests/unit/django/conftest.py
  • tests/unit/django/constants.py
  • tests/unit/django/test_charm.py
  • tests/unit/django/test_workers.py
  • tests/unit/fastapi/init.py
  • tests/unit/fastapi/conftest.py
  • tests/unit/fastapi/constants.py
  • tests/unit/fastapi/test_charm.py
  • tests/unit/flask/init.py
  • tests/unit/flask/conftest.py
  • tests/unit/flask/constants.py
  • tests/unit/flask/test_charm.py
  • tests/unit/flask/test_charm_state.py
  • tests/unit/flask/test_database_migration.py
  • tests/unit/flask/test_databases.py
  • tests/unit/flask/test_flask_app.py
  • tests/unit/flask/test_tracing.py
  • tests/unit/flask/test_webserver.py
  • tests/unit/flask/test_workers.py
  • tests/unit/go/init.py
  • tests/unit/go/conftest.py
  • tests/unit/go/constants.py
  • tests/unit/go/test_app.py
  • tests/unit/go/test_charm.py
  • tests/unit/test_deprecated.py
  • tox.ini
Use this command to fix any missing license headers
```bash

docker run -it --rm -v $(pwd):/github/workspace apache/skywalking-eyes header fix

</details>

app.py Outdated Show resolved Hide resolved
src/paas_charm/templates/gunicorn.conf.py.j2 Outdated Show resolved Hide resolved
src/paas_charm/templates/gunicorn.conf.py.j2 Show resolved Hide resolved
src/paas_charm/templates/gunicorn.conf.py.j2 Outdated Show resolved Hide resolved
src/paas_charm/templates/gunicorn.conf.py.j2 Show resolved Hide resolved
src/paas_charm/_gunicorn/webserver.py Outdated Show resolved Hide resolved
src/paas_charm/_gunicorn/webserver.py Show resolved Hide resolved
src/paas_charm/charm.py Outdated Show resolved Hide resolved
src/paas_charm/charm_state.py Outdated Show resolved Hide resolved
@@ -73,7 +72,7 @@ def _on_ingress_revoked(self, event: IngressPerAppRevokedEvent):

# Increment this PATCH version before using `charmcraft publish-lib` or reset
# to 0 if you are raising the major API version
LIBPATCH = 14
LIBPATCH = 13
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks like we're going backwards on the version here? Is version 14 available, or perhaps an even later version?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the library is in an example folder, they're not automatically updated, all the other examples are using version 13, so Ali aligned.
I think it should be good to:

  • Upgrade the libraries manually once to get the latest
  • Add a story to find a way to automate this library upgrade via juju action or renovate

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could done in a separate PR as it's unrelated to this PR

@@ -73,7 +72,7 @@ def _on_ingress_revoked(self, event: IngressPerAppRevokedEvent):

# Increment this PATCH version before using `charmcraft publish-lib` or reset
# to 0 if you are raising the major API version
LIBPATCH = 14
LIBPATCH = 13
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the library is in an example folder, they're not automatically updated, all the other examples are using version 13, so Ali aligned.
I think it should be good to:

  • Upgrade the libraries manually once to get the latest
  • Add a story to find a way to automate this library upgrade via juju action or renovate

requirements.txt Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should pin dependencies in requirements.txt

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be tackled in another PR as it's not related to Tempo tracing

@@ -20,6 +20,95 @@
logger = logging.getLogger(__name__)


class TempoParameters(BaseModel):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're even not consistent because IntegrationState is declared after CharmState but used in a hint in CharmState
I don't like when a linting/hinting tool dictate the structure of the code (in the sense that we do things to please it). The fact that the class must be declared before to be used without strings in the typehints is a limitation of mypy and should force us to go to a less natural ordering.
Usually I'm in favor of ordering in the natural code execution order, as when you reason about the code, you're following it in the order of execution. And that's the order defined in our coding guideline. Generally I'm pretty flexible there, since a small data object (like HTTPProxy) before the CharmState doesn't alter too much the readability, and allows to immediately know Proxy is properly manage in the charm. But when the CharmState becomes more complex with embedded state object, I prefer reading the charmstate first and drill down.

So as a conclusion:

  • Simple charmstate with few data object, I'm fine having them defined first
  • More complex charmstate, I'd rather have the charmstate first

@@ -498,7 +492,7 @@ def _create_charm_state(self) -> CharmState:
s3_connection_info=self._s3.get_s3_connection_info() if self._s3 else None,
saml_relation_data=saml_relation_data,
rabbitmq_uri=self._rabbitmq.rabbitmq_uri() if self._rabbitmq else None,
tracing_relation_data=tracing_relation_data,
tempo_parameters=TempoParameters.from_charm(name=self.app.name, tracing=self._tracing),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like the approach is incoherent compared to how other optional relations are treated. S3 and SAML for example don't use a from_charm passed to the charmstate.
Instead they're passing their parameter to the CharmState and then it leverages the IntegrationState.build to generate the Parameters objects.

So what I suggest:

  • Check if the relation exists is done in this method for other relation
  • Similarly to saml_relation_data, build a dict that is either None or contains the data required for the TempoParameters
  • Pass that dict to the CharmState.from_charm, that will use the IntegrationState.build with these parameters, to return the TempoParameters

@canonical canonical deleted a comment from github-actions bot Jan 29, 2025
@canonical canonical deleted a comment from github-actions bot Jan 29, 2025
@canonical canonical deleted a comment from github-actions bot Jan 29, 2025
Copy link
Contributor

Test coverage for d2899a0

Name                                          Stmts   Miss Branch BrPart  Cover   Missing
-----------------------------------------------------------------------------------------
src/paas_app_charmer/__init__.py                  2      0      0      0   100%
src/paas_app_charmer/django/__init__.py           2      0      0      0   100%
src/paas_app_charmer/django/charm.py              2      0      0      0   100%
src/paas_app_charmer/fastapi/__init__.py          2      0      0      0   100%
src/paas_app_charmer/fastapi/charm.py             2      0      0      0   100%
src/paas_app_charmer/flask/__init__.py            2      0      0      0   100%
src/paas_app_charmer/flask/charm.py               2      0      0      0   100%
src/paas_app_charmer/go/__init__.py               2      0      0      0   100%
src/paas_app_charmer/go/charm.py                  2      0      0      0   100%
src/paas_charm/__init__.py                       32     17      0      0    47%   13-14, 19-20, 26-27, 33-37, 43-44, 50-51, 57-58
src/paas_charm/_gunicorn/__init__.py              0      0      0      0   100%
src/paas_charm/_gunicorn/charm.py                42      0      6      0   100%
src/paas_charm/_gunicorn/webserver.py            90      4     16      1    95%   209, 221-227
src/paas_charm/_gunicorn/workload_config.py       8      0      0      0   100%
src/paas_charm/_gunicorn/wsgi_app.py             21      0      2      0   100%
src/paas_charm/app.py                           172      0     62      5    98%   115->exit, 172->178, 282->284, 284->287, 365->367
src/paas_charm/charm.py                         294     35     62      4    88%   35-36, 43-44, 51-52, 165-166, 188-189, 209-210, 260-261, 305, 315-316, 318-319, 348-352, 420, 520-521, 526, 531, 536, 546, 551, 556, 561, 566, 591, 626
src/paas_charm/charm_state.py                   123      2     12      2    97%   177, 325
src/paas_charm/charm_utils.py                    23      0      0      0   100%
src/paas_charm/database_migration.py             35      0      2      0   100%
src/paas_charm/databases.py                      25      2      6      1    90%   89-90
src/paas_charm/django/__init__.py                 2      0      0      0   100%
src/paas_charm/django/charm.py                   50      4      8      2    90%   49, 124, 139-140
src/paas_charm/exceptions.py                      5      0      0      0   100%
src/paas_charm/fastapi/__init__.py                2      0      0      0   100%
src/paas_charm/fastapi/charm.py                  31      0      0      0   100%
src/paas_charm/flask/__init__.py                  2      0      0      0   100%
src/paas_charm/flask/charm.py                    26      0      0      0   100%
src/paas_charm/framework.py                      23      4     12      2    77%   36, 49-51
src/paas_charm/go/__init__.py                     2      0      0      0   100%
src/paas_charm/go/charm.py                       28      0      0      0   100%
src/paas_charm/observability.py                  24      3      4      1    86%   42->46, 73-77
src/paas_charm/rabbitmq.py                       78      2     22      5    93%   117->exit, 122->exit, 157->exit, 159-160, 181->175
src/paas_charm/secret_storage.py                 50      2     14      4    91%   55->54, 56->58, 86, 105
src/paas_charm/utils.py                          44      7     14      5    79%   34, 36, 56-57, 75, 79, 104
-----------------------------------------------------------------------------------------
TOTAL                                          1250     82    242     32    92%

Static code analysis report

Run started:2025-01-29 11:18:31.267099

Test results:
  No issues identified.

Code scanned:
  Total lines of code: 2684
  Total lines skipped (#nosec): 1
  Total potential issues skipped due to specifically being disabled (e.g., #nosec BXXX): 2

Run metrics:
  Total issues (by severity):
  	Undefined: 0
  	Low: 0
  	Medium: 0
  	High: 0
  Total issues (by confidence):
  	Undefined: 0
  	Low: 0
  	Medium: 0
  	High: 0
Files skipped (0):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants