grafana / k8s-monitoring-helm

Apache License 2.0
135 stars 57 forks source link

Traces and Profiles missing extraConfig block #565

Open bentonam opened 3 weeks ago

bentonam commented 3 weeks ago

Add support for traces and profiles extraConfig block.

geertn commented 6 days ago

Good to see you are working on this! Is it possible to Cherry pick the fix and merge this already? Currently we are working around this "bug" by patching the configmap after deployment. It would be great if we can leverage your fix without having to patch our helm chart locally.

petewall commented 5 days ago

Currently we have:

extraConfig: ... # Adds config to the "alloy" instance
logs:
  extraConfig: ... # Adds config to the "alloy-logs" instance
  cluster_events:
    extraConfig: ... # Adds config to the "alloy-events" instance
  journal:
    extraConfig: ... # Not used anywhere currently

We could add:

profiles:
  extraConfig: ... # Adds config to the "alloy-profiles" instance

Trace receivers exist on the alloy instance, so the top-level extraConfig should be sufficient.

petewall commented 5 days ago

So, a few options:

  1. Smallest change: Add exttraConfig for profiles, the only place that is missing the ability:

    profiles:
    extraConfig: ... # Adds config to the "alloy-profiles" instance
  2. More logical sense, but breaking: Deprecate the existing extraConfigs and instead put them inside the alloy instances. to make it clearer where they're being deployed:

alloy:
  extraConfig: ...
alloy-events:
  extraConfig: ...
alloy-logs:
  extraConfig: ...
alloy-profiles:
  extraConfig: ...
geertn commented 5 days ago

My thoughts as a user: Both options would work for me but option 2 seems more logical. Maybe overthinking but since the alloy block seems to already deal with configs

alloy:
  alloy:
    extraConfig: ...
alloy-events:
  alloy:
    extraConfig: ...
alloy-logs:
  alloy:
    extraConfig: ...
alloy-profiles:
  alloy:
    extraConfig: ...

Afterburner: is there a reason alloy isn't named alloy-metrics?

petewall commented 5 days ago

Let me chat with some folks internally and we'll make a plan.

Afterburner: is there a reason alloy isn't named alloy-metrics?

Because the "main" alloy instance scrapes metrics, but also opens the receivers, which then can pick up traces, as well as metrics and logs pushed via OTLP, OTLP HTTP, Zipkin, Jaeger, etc... It mostly does metrics, but it can do much more than just metrics.