open-telemetry / opentelemetry-helm-charts

OpenTelemetry Helm Charts
https://opentelemetry.io
Apache License 2.0
389 stars 468 forks source link

[opentelemetry-kube-stack] `scrape_configs_file` is basically useless #1331

Open kristeey opened 1 week ago

kristeey commented 1 week ago

Hi, Trying out different features in the opentelemetry-kube-stack helm chart, and came over the scrape_configs_file attribute in the collectors.collectorName section. This is basically useless unless the user wants to use the default scrape config that comes with the helm chart deamon_scrape_configs.yaml or the user clones the chart and installes the helm chart locally. When installing the helm chart using the remote repository it is not possible to include "external" scrape config files into the helm structure (because of helm...). This is also the case when the chart is used as a subchart, and the scrape config files exists in the parent chart. Quoting the helm docs:

"Files outside of a Helm application subchart, including those of the parent, cannot be accessed"

this is a limitation with the .Files object in Helm.

dosubot[bot] commented 1 week ago

Hey @kristeey! I'm here to help you with any bugs, questions, or contributions you have. Let's tackle this together!

The scrape_configs_file attribute in the opentelemetry-kube-stack Helm chart indeed has limitations when it comes to including external scrape config files, especially when using the chart from a remote repository or as a subchart. This is due to the constraints of the .Files object in Helm, which cannot access files outside of the Helm chart's directory structure.

However, there are workarounds to include external scrape config files:

  1. Direct Configuration in values.yaml: You can directly add your scrape configurations in the values.yaml file under the config section. Here is an example:

    config:
     receivers:
       prometheus:
         config:
           scrape_configs:
             - job_name: 'external-scrape-config'
               scrape_interval: 15s
               static_configs:
                 - targets: ['example.com:9090']
  2. Customizing the Chart Locally: If you need to include a file, you can clone the chart repository, add your custom scrape config file, and then install the chart locally.

  3. Using ConfigMaps: Another approach is to create a ConfigMap with your scrape configurations and reference it in your Helm chart. This method requires additional setup but can be more flexible.

For more detailed guidance, you can refer to the OpenTelemetry Kubernetes Getting Started Guide [1].

To continue talking to Dosu, mention @dosu.