canonical / prometheus-k8s-operator

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

Enable override of interface name #335

Closed jnsgruk closed 2 years ago

jnsgruk commented 2 years ago

Issue

The Prometheus scrape_targets config structure is used by quite a few different applications. The lib in its current form means that we'll always need to use the prometheus_scrape interface name for this library to work, which may introduce unforseen bugs if there are multiple apps using the same interface structure, and could get wired up wrong at runtime.

Solution

This is submitted for discussion - and would enable the ability for charm developers to use the library for a custom relation name. The changes only cover MetricsEndpointProvider and MetricsEndpointConsumer at this point. I don't forsee the MetricsEndpointAggregator being universally useful in the same way.

github-actions[bot] commented 2 years ago

Libraries are not up to date with their remote counterparts. If this was not intentional, run charmcraft fetch-libs and commit the updated libs to your PR branch.

stdout ``` Library charms.alertmanager_k8s.v0.alertmanager_dispatch was already up to date in version 0.4. Library charms.grafana_k8s.v0.grafana_dashboard updated to version 0.13. Library charms.grafana_k8s.v0.grafana_source updated to version 0.11. Library charms.observability_libs.v0.juju_topology was already up to date in version 0.2. Library charms.observability_libs.v0.kubernetes_service_patch was already up to date in version 0.6. Library charms.prometheus_k8s.v0.prometheus_remote_write has local changes, cannot be updated. Library charms.prometheus_k8s.v0.prometheus_scrape has local changes, cannot be updated. Library charms.traefik_k8s.v0.ingress_per_unit has local changes, cannot be updated. ```
stderr ``` ```
jnsgruk commented 2 years ago

Debating in my mind if a better plan here is to fork the lib?

sed-i commented 2 years ago

Iiuc, the working assumptions so far were:

multiple apps using the same interface structure

Would you mind clarifying the context?

jnsgruk commented 2 years ago

Yeh, I'm gonna rethink this.