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

Return empty receivers list if tracing backend isn't connected #338

Merged
merged 2 commits into from
Dec 20, 2024

Conversation

mmkay
Copy link
Contributor

@mmkay mmkay commented Dec 18, 2024

Issue

When a tracing backend isn't connected, grafana-agent errors out due to a missing guard. Also, when the guard is added, the same issue as in canonical/grafana-agent-operator#219 appears.

Solution

Add the same guard as in the machine charm. Also return an empty receivers list if the upstream tracing backend isn't ready yet.

Context

Testing Instructions

Deploy the following bundle:

bundle: kubernetes
applications:
  grafana-agent-k8s:
    charm: local:grafana-agent-k8s-2
    scale: 1
    constraints: arch=amd64
    storage:
      data: kubernetes,1,1024M
  postgresql-k8s:
    charm: postgresql-k8s
    channel: 14/edge
    revision: 470
    resources:
      postgresql-image: 164
    scale: 1
    constraints: arch=amd64
    storage:
      pgdata: kubernetes,1,1024M
    trust: true
relations:
- - postgresql-k8s:tracing
  - grafana-agent-k8s:tracing-provider

Observe that neither of the charms errors out or shows pydantic validation errors once the relation settles. At this moment, postgres is expected to throw this error:

unit-postgresql-k8s-0: 15:33:21 ERROR unit.postgresql-k8s/0.juju-log no receiver found with protocol='otlp_http'

This should become a warning once canonical/tempo-coordinator-k8s-operator#95 is merged and the library gets updated.

Upgrade Notes

@mmkay mmkay requested a review from a team as a code owner December 18, 2024 15:21
src/grafana_agent.py Show resolved Hide resolved
src/grafana_agent.py Outdated Show resolved Hide resolved
@mmkay mmkay merged commit a2f5522 into main Dec 20, 2024
13 checks passed
@mmkay mmkay deleted the fix/empty-tracing-endpoints branch December 20, 2024 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants