canonical / prometheus-k8s-operator

https://charmhub.io/prometheus-k8s
Apache License 2.0
21 stars 35 forks source link

Add diagnostics tox env #472

Open sed-i opened 1 year ago

sed-i commented 1 year ago

Issue

When doing manual tests, I keep using the same lengthy commands over and over.

Solution

Add a diagnostics script to output all the interesting integration-related content.

Context

Came up in during work on https://github.com/canonical/grafana-agent-k8s-operator/pull/160.

Testing Instructions

tox -e diag -- prom/0

Release Notes

Add diagnostics tox env.

lucabello commented 1 year ago

I feel like this type of content could have its own cos-operations repository, or something similar, collecting commands/scripts/recipes we commonly use; I guess it depends on the scope :)

Regardless, I'd use the word diagnostic (or diagnostics) instead of diag since all the other tox environments are full names, not a shorthand

sed-i commented 1 year ago

How about:

pip install cosl
cosl.diag prometheus prom/0
rbarry82 commented 1 year ago

How about:

pip install cosl
cosl.diag prometheus prom/0

I mean, couldn't tox just install it as part of the env? And run the command?

I still don't think diag provides enough context. "Hit the API for this particular workload type and print the results" is useful, but it should have a name which reflects what it actually does, because it definitely isn't "diagnosing" anything. Just different kind of juju show-....

Arguably, the best would be to get the Juju team to extend jujuc to behave like kubectl or others, where juju-show-unit -> juju show-unit, juju-show-workload -> juju show-workload ... (which could be further be extended with workload types by different charming teams)

sed-i commented 1 year ago

It's not diagnosing anything yet :) But I'm not fixed on the name. self-test, check, whatever is fine.

Not sure what you mean about jujuc. Are you talking about juju plugins?