|
49 | 49 | from charms.prometheus_k8s.v0.prometheus_scrape import MetricsEndpointProvider
|
50 | 50 | from charms.rolling_ops.v0.rollingops import RollingOpsManager
|
51 | 51 | from charms.tempo_coordinator_k8s.v0.charm_tracing import trace_charm
|
52 |
| -from charms.tempo_coordinator_k8s.v0.tracing import TracingEndpointRequirer |
| 52 | +from charms.tempo_coordinator_k8s.v0.tracing import TracingEndpointRequirer, charm_tracing_config |
53 | 53 | from ops import EventBase, RelationBrokenEvent, RelationCreatedEvent
|
54 | 54 | from ops.charm import RelationChangedEvent, UpdateStatusEvent
|
55 | 55 | from ops.model import (
|
|
89 | 89 | SERVER_CONFIG_USERNAME,
|
90 | 90 | TRACING_PROTOCOL,
|
91 | 91 | TRACING_RELATION_NAME,
|
| 92 | + CHARM_CA_CERT_PATH, |
92 | 93 | )
|
93 | 94 | from k8s_helpers import KubernetesHelpers
|
94 | 95 | from log_rotate_manager import LogRotateManager
|
|
104 | 105 |
|
105 | 106 |
|
106 | 107 | @trace_charm(
|
107 |
| - tracing_endpoint="tracing_endpoint", |
| 108 | + tracing_endpoint="charm_tracing_endpoint", |
| 109 | + server_cert="charm_tracing_server_cert", |
108 | 110 | extra_types=(
|
109 | 111 | GrafanaDashboardProvider,
|
110 | 112 | KubernetesHelpers,
|
@@ -197,11 +199,13 @@ def __init__(self, *args):
|
197 | 199 | self, protocols=[TRACING_PROTOCOL], relation_name=TRACING_RELATION_NAME
|
198 | 200 | )
|
199 | 201 |
|
200 |
| - @property |
201 |
| - def tracing_endpoint(self) -> Optional[str]: |
202 |
| - """Otlp http endpoint for charm instrumentation.""" |
203 |
| - if self.tracing.is_ready(): |
204 |
| - return self.tracing.get_endpoint(TRACING_PROTOCOL) |
| 202 | + self.charm_tracing_endpoint, self.charm_tracing_server_cert = charm_tracing_config( |
| 203 | + self.tracing, |
| 204 | + # Fixme: this None here means that if Tempo is related to a tls certificate provider, |
| 205 | + # and mysql is getting an https endpoint from tempo, you will get a big fat warning |
| 206 | + # and tracing will be disabled as tempo will reject non-https connections. |
| 207 | + # https://github.com/canonical/mysql-k8s-operator/issues/586 |
| 208 | + None) |
205 | 209 |
|
206 | 210 | @property
|
207 | 211 | def _mysql(self) -> MySQL:
|
|
0 commit comments