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

Update models and interface tests for tracing and tempo_cluster to match current state #174

Merged
merged 7 commits into from
Sep 26, 2024

Conversation

mmkay
Copy link
Contributor

@mmkay mmkay commented Sep 6, 2024

This PR updates tracing and tempo_cluster interface definitions and their respective interface tests. It also:

  • retires tracing v0 interface that is no longer supported by any of the tempo charms
  • adds tempo-coordinator to charms that support tracing v2

In order for the tests to pass, this PR requires canonical/tempo-worker-k8s-operator#27 and canonical/tempo-coordinator-k8s-operator#32 to be merged first.

Context

mmkay and others added 4 commits September 6, 2024 13:36
tempo_config is now worker_config

Set optional fields in JujuTopology

Add worker relation to state

Make config optional

default: None

Make juju topology optional

Proper test cases for provider

provider: Only tests that do validation on existing state assuming statelessness

Add required s3 to the test context

Provider: convert databags to json

json.dumps( on each field, not on whole databag

Use assert_relation_data_empty instead of exceptions

comment out other provider tests

Add required unit data

pack dict to string

Experiment: using DatabagModel from o11y HA cluster objects

Don't json.dumps JujuTopology

temp make jujutopology optional and don't include it in test

json.dumps on address too

try doing json.dumps on each of fields in JujuTopology

tracing: drop tempo_ protocols from requested list

Add tempo-coordinator and grafana-agent-k8s as tracing v2 providers

focus on fixing tempo first

Use tempo from branch with tempo-ready service

interface-fix branch on all tracing versions

tempo-k8s is no longer provider for tracing/v0 and tracing/v1

Uncomment grafana-agent-k8s for tracing/v2

Use branch of grafana-agent-k8s with interface tests support

tempo-k8s already has the fix merged

just the coordinator for now

dumps entire topology

Is it just unit and charm_name that was missing?

Remove spare s3 relation ignored anyway

Custom tester

override location too

Add Json to schema

Ignore exact contents of loki_endpoints

I forgot a bracket

Enable other tests from tempo_cluster provider interface

Enable requirer tests

Add config section to relation databags

empty json as worker config

One field in json

Have a basic yaml

just the worker to focus debugging

json.dumps on pseudo-yaml

One test is enough, for clarity

Try adding local data

add role to app databag

juju topology as string

Leave local data out - it's the charm that should fill them

local data are back

remove dumps on role

Remove dumps on topology again

So we need dumps

do we need to specify jujutopology?

Dumps juju_topology

disable local databags for now

is it wrong endpoint naming?

this isn't it. add local databags again

try mocking topology in charm

Add remote_write_endpoints to schema

Wrong order of properties

focus on requirer again

change to cluster-created

Pack everything into Json

add model config

drop model and model_uuid and rename JujuTopology to _Topology

does whole tempo_cluster work now?

Add cluster-changed test and check

non-happy flow

juju topology will always be filled

Point at right fixture in tempo-coordinator for tracing tests

Requested protocols are part of app data

remove tests on action that doesn't work

point at squashed branches to test they still work

Move to main branches of tempo HA repos
@simskij
Copy link
Member

simskij commented Sep 9, 2024

@benhoyt @tonyandrewmeyer @dimaqq @IronCore864: could one of you have a look at this one? I preferably don't want to approve my own team's PRs.

@dimaqq
Copy link
Contributor

dimaqq commented Sep 10, 2024

Main question: what does "to match current state" (PR heading) mean?
Context additional to the PR description would also help 🙏🏻

Copy link
Contributor

@dimaqq dimaqq left a comment

Choose a reason for hiding this comment

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

I've looked at related PRs and the schema change, but not the Python code.

I think I'd like clarification on the above first.

@mmkay
Copy link
Contributor Author

mmkay commented Sep 16, 2024

Main question: what does "to match current state" (PR heading) mean? Context additional to the PR description would also help 🙏🏻

@dimaqq: I have added an explanation in the description of the PR. Hope it explains the changes well enough but please feel free to ask to clarify anything that still seems off.

Copy link
Contributor

@tonyandrewmeyer tonyandrewmeyer left a comment

Choose a reason for hiding this comment

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

This generally looks fine to me, without deep knowledge of the tracing interfaces being used at the moment.

One item of test data that definitely should be fixed, and a couple of small questions.

interfaces/tempo_cluster/v0/schema.py Show resolved Hide resolved
interfaces/tempo_cluster/v0/schema.py Show resolved Hide resolved
@tonyandrewmeyer
Copy link
Contributor

For the failing tests, I think @canonical/charm-tech need to do some additional work in getting both this repo and pytest-interface-tester to be fully Scenario 7 compatible. @IronCore864 and/or I will work on that today.

@IronCore864
Copy link
Contributor

Per discussion on Mattermost, this PR has been reviewed and tested locally, and everything passes. Regarding the failed quality checks (unit tests and integration tests), please merge the main branch (which contains the fix here). @mmkay

@IronCore864 IronCore864 merged commit 2c9617e into canonical:main Sep 26, 2024
6 checks passed
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.

5 participants