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 tracing to use OTLP/HTTP #569

Merged
merged 1 commit into from
Feb 1, 2024
Merged

Update tracing to use OTLP/HTTP #569

merged 1 commit into from
Feb 1, 2024

Conversation

mmkay
Copy link
Contributor

@mmkay mmkay commented Jan 31, 2024

Issue

Prometheus charm grew significantly in size due to a new GRPC dependency introduced by tracing as noticed in #545. Because of that, we reconsidered the protocol used by tracing in canonical/tempo-k8s-operator#53 and decided to use OTLP/HTTP.

Solution

Switch to the new version of charm_tracing and use OTLP/HTTP(S) endpoints of tempo.

Context

This PR implicitly bumps pydantic used by tracing to v2 which is a complete rewrite in Rust. Because rust compiler isn't found in charmcraft pack in this repo I needed to add pydantic to charm-binary-python-packages.

Testing Instructions

First run charmcraft pack to see that prometheus charm is now reduced back to 26MB.

Then, using the packed charm, use the following bundle:

bundle: kubernetes
applications:
  alertmanager:
    charm: alertmanager-k8s
    channel: stable
    revision: 96
    series: focal
    resources:
      alertmanager-image: 84
    scale: 1
    constraints: arch=amd64
    storage:
      data: kubernetes,1,1024M
    trust: true
  catalogue:
    charm: catalogue-k8s
    channel: stable
    revision: 33
    series: focal
    resources:
      catalogue-image: 32
    scale: 1
    options:
      description: "Canonical Observability Stack Lite, or COS Lite, is a light-weight,
        highly-integrated, \nJuju-based observability suite running on Kubernetes.\n"
      tagline: Model-driven Observability Stack deployed with a single command.
      title: Canonical Observability Stack
    constraints: arch=amd64
    trust: true
  grafana:
    charm: grafana-k8s
    channel: stable
    revision: 93
    series: focal
    resources:
      grafana-image: 62
      litestream-image: 43
    scale: 1
    constraints: arch=amd64
    storage:
      database: kubernetes,1,1024M
    trust: true
  loki:
    charm: loki-k8s
    channel: stable
    revision: 105
    series: focal
    resources:
      loki-image: 88
    scale: 1
    constraints: arch=amd64
    storage:
      active-index-directory: kubernetes,1,1024M
      loki-chunks: kubernetes,1,1024M
    trust: true
  prometheus-k8s:
    charm: local:prometheus-k8s-0
    series: focal
    scale: 1
    constraints: arch=amd64
    storage:
      database: kubernetes,1,1024M
    trust: true
  self-signed-certificates:
    charm: self-signed-certificates
    channel: stable
    revision: 57
    scale: 1
    constraints: arch=amd64
  tempo-k8s:
    charm: tempo-k8s
    channel: candidate
    revision: 22
    resources:
      tempo-image: 14
    scale: 1
    constraints: arch=amd64
    storage:
      data: kubernetes,1,1024M
  traefik:
    charm: traefik-k8s
    channel: stable
    revision: 166
    series: focal
    resources:
      traefik-image: 155
    scale: 1
    constraints: arch=amd64
    storage:
      configurations: kubernetes,1,1024M
    trust: true
relations:
- - traefik:ingress-per-unit
  - loki:ingress
- - traefik:traefik-route
  - grafana:ingress
- - traefik:ingress
  - alertmanager:ingress
- - grafana:grafana-source
  - loki:grafana-source
- - grafana:grafana-source
  - alertmanager:grafana-source
- - loki:alertmanager
  - alertmanager:alerting
- - grafana:grafana-dashboard
  - loki:grafana-dashboard
- - grafana:grafana-dashboard
  - alertmanager:grafana-dashboard
- - catalogue:ingress
  - traefik:ingress
- - catalogue:catalogue
  - grafana:catalogue
- - catalogue:catalogue
  - alertmanager:catalogue
- - tempo-k8s:grafana-source
  - grafana:grafana-source
- - prometheus-k8s:certificates
  - self-signed-certificates:certificates
- - tempo-k8s:tracing
  - prometheus-k8s:tracing
- - traefik:metrics-endpoint
  - prometheus-k8s:metrics-endpoint
- - prometheus-k8s:grafana-source
  - grafana:grafana-source

You should be able to see traces in Grafana:
Screenshot from 2024-01-31 19-07-25

Release Notes

Copy link
Contributor

@PietroPasotti PietroPasotti left a comment

Choose a reason for hiding this comment

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

very nice! have you tested it with and without TLS I presume?

@mmkay
Copy link
Contributor Author

mmkay commented Feb 1, 2024

Correct - tried both scenarios. In both cases I had traces coming in.

@mmkay mmkay merged commit d7a20a6 into main Feb 1, 2024
13 checks passed
@mmkay mmkay deleted the update-tracing-to-http branch February 1, 2024 09:24
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.

None yet

2 participants