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

Сonfiguration prometheus.exporter.process #1935

Open
orlovds opened this issue Oct 21, 2024 · 4 comments
Open

Сonfiguration prometheus.exporter.process #1935

orlovds opened this issue Oct 21, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@orlovds
Copy link

orlovds commented Oct 21, 2024

What's wrong?

Good afternoon,
please tell me how to force prometheus.exporter.process collect data about all processes on VM?
An analog of the setting in process_exporter:

cat > /etc/process-exporter.yml << EOF
process_names:
 - name: "{{.Comm}}"
 cmdline:
 - '.+'
EOF

Steps to reproduce

Run alloy and request data
Image

System information

ALT SP Server 11100-01

Software version

alloy, version v1.4.2

Configuration

// Process metrics
prometheus.exporter.process "local" {
track_children = true
}

// Configure a prometheus.scrape component to collect process_exporter metrics.
prometheus.scrape "process" {
targets = prometheus.exporter.process.local.targets
forward_to = [prometheus.remote_write.mimir.receiver]
}

Logs

No response

@orlovds orlovds added the bug Something isn't working label Oct 21, 2024
@Nachtfalkeaw
Copy link

Nachtfalkeaw commented Oct 22, 2024

//=======================================================================================
// BEGINN: PROCESS EXPORTER
//=======================================================================================
// Scrape für Process Exporter
prometheus.scrape "process_exporter" {
  job_name = "process_exporter"    // sonst heißt der job "prometheus.scrape.process_exporter"
  scrape_interval = "15s"
  scrape_timeout = "14s"
  extra_metrics = true

  targets    = prometheus.exporter.process.all.targets
  forward_to = [prometheus.relabel.node_exporter.receiver]  //andere .alloy fiel
}


//=======================================================================================
// Systemprozesse / Process Exporter

prometheus.exporter.process "all" {
  procfs_path = "/proc"
  track_children = true
  track_threads = true
  gather_smaps = true
  recheck_on_scrape = true

  matcher {
    name = "{{.Comm}}"
    cmdline = [".+"]
  }
}


//=======================================================================================
// Setzt als "job" den Name "process_exporter" weil es oben mit "job_name" in "prometheus.scrape.process_exporter" nicht funktioniert.
// ersetzt den Wert des labels "job" mit "node_exporter"

//prometheus.relabel "process_exporter" {

  // relabel Funktion
//  rule {
//    action        = "replace"
//    replacement   = "process_exporter"
//    target_label  = "job"
//  }

  // Anschließend die Metriken an die remote_write config senden
//  forward_to = [prometheus.relabel.localhost.receiver]
//}
//=======================================================================================
// ENDE: PROCESS EXPORTER
//=======================================================================================

@orlovds
Copy link
Author

orlovds commented Oct 23, 2024

@Nachtfalkeaw Friend, thank you so much!!!
It's a pity that all this is not in documentation...

@Nachtfalkeaw
Copy link

Many of these components are based on standalone exporters and there is a chance to get some more information.

https://github.com/ncabatoff/process-exporter

@orlovds
Copy link
Author

orlovds commented Oct 24, 2024

@Nachtfalkeaw Of course, but if there https://grafana.com/docs/alloy/latest/reference/components/prometheus/prometheus.exporter.process/#example was your example from this issues, it would be much clearer....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants