You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2021/08/21 23:41:07 UTC
[skywalking-satellite] branch main updated: docs: add prometheus
fetcher documents (#60)
This is an automated email from the ASF dual-hosted git repository.
wusheng pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-satellite.git
The following commit(s) were added to refs/heads/main by this push:
new ec1cdbd docs: add prometheus fetcher documents (#60)
ec1cdbd is described below
commit ec1cdbd4365a7ea4feaaf6cb2861ef1bf85cc391
Author: kv <gx...@163.com>
AuthorDate: Sun Aug 22 07:41:02 2021 +0800
docs: add prometheus fetcher documents (#60)
---
configs/satellite_config.yaml | 48 ----------------------
.../plugins/fetcher_prometheus-metrics-fetcher.md | 23 ++++++++---
plugins/fetcher/prometheus/fetcher.go | 22 +++++++---
3 files changed, 34 insertions(+), 59 deletions(-)
diff --git a/configs/satellite_config.yaml b/configs/satellite_config.yaml
index 0ea59ab..b7b64f6 100644
--- a/configs/satellite_config.yaml
+++ b/configs/satellite_config.yaml
@@ -247,51 +247,3 @@ pipes:
client_name: grpc-client
forwarders:
- plugin_name: nativemeter-grpc-forwarder
- - common_config:
- pipe_name: prometheus-fetcher
- gatherer:
- fetcher:
- plugin_name: "prometheus-metrics-fetcher"
- scrape_configs:
- - job_name: 'prometheus'
- metrics_path: '/metrics'
- scrape_interval: 10s
- static_configs:
- - targets:
- - "127.0.0.1:9100"
- - job_name: 'prometheus-k8s'
- metrics_path: '/metrics'
- scrape_interval: 10s
- tls_config:
- ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
- bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
- kubernetes_sd_configs:
- - role: pod
- selectors:
- - role: pod
- label: "app=prometheus"
- relabel_configs:
- - source_labels: [ __meta_kubernetes_pod_name ]
- separator: ;
- regex: (.*)
- target_label: pod
- replacement: $1
- action: replace
- queue:
- plugin_name: "memory-queue"
- # The maximum buffer event size.
- event_buffer_size: ${SATELLITE_QUEUE_EVENT_BUFFER_SIZE:5000}
- processor:
- filters:
- sender:
- fallbacker:
- plugin_name: none-fallbacker
- # The time interval between two flush operations. And the time unit is millisecond.
- flush_time: ${SATELLITE_PROMETHEUS_SENDER_FLUSH_TIME:1000}
- # The maximum buffer elements.
- max_buffer_size: ${SATELLITE_PROMETHEUS_SENDER_MAX_BUFFER_SIZE:200}
- # The minimum flush elements.
- min_flush_events: ${SATELLITE_PROMETHEUS_SENDER_MIN_FLUSH_EVENTS:1}
- client_name: grpc-client
- forwarders:
- - plugin_name: nativecds-grpc-forwarder
diff --git a/docs/en/setup/plugins/fetcher_prometheus-metrics-fetcher.md b/docs/en/setup/plugins/fetcher_prometheus-metrics-fetcher.md
index b56e960..b55896f 100755
--- a/docs/en/setup/plugins/fetcher_prometheus-metrics-fetcher.md
+++ b/docs/en/setup/plugins/fetcher_prometheus-metrics-fetcher.md
@@ -3,11 +3,22 @@
This is a fetcher for Skywalking prometheus metrics format, which will translate Prometheus metrics to Skywalking meter system.
## DefaultConfig
```yaml
-## some config here
scrape_configs:
- - job_name: 'prometheus'
- metrics_path: '/metrics'
- scrape_interval: 10s
- static_configs:
- - targets: ['127.0.0.1:2020']
+- job_name: 'prometheus'
+ metrics_path: '/metrics'
+ scrape_interval: 10s
+ static_configs:
+ - targets:
+ - "127.0.0.1:9100"
+- job_name: 'prometheus-k8s'
+ metrics_path: '/metrics'
+ scrape_interval: 10s
+ tls_config:
+ ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
+ bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
+ kubernetes_sd_configs:
+ - role: pod
+ selectors:
+ - role: pod
+ label: "app=prometheus"
```
diff --git a/plugins/fetcher/prometheus/fetcher.go b/plugins/fetcher/prometheus/fetcher.go
index e1f4bdf..573a86b 100644
--- a/plugins/fetcher/prometheus/fetcher.go
+++ b/plugins/fetcher/prometheus/fetcher.go
@@ -99,11 +99,23 @@ func (f *Fetcher) Description() string {
func (f *Fetcher) DefaultConfig() string {
return `
scrape_configs:
- - job_name: 'prometheus'
- metrics_path: '/metrics'
- scrape_interval: 10s
- static_configs:
- - targets: ['127.0.0.1:9100']
+- job_name: 'prometheus'
+ metrics_path: '/metrics'
+ scrape_interval: 10s
+ static_configs:
+ - targets:
+ - "127.0.0.1:9100"
+- job_name: 'prometheus-k8s'
+ metrics_path: '/metrics'
+ scrape_interval: 10s
+ tls_config:
+ ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
+ bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
+ kubernetes_sd_configs:
+ - role: pod
+ selectors:
+ - role: pod
+ label: "app=prometheus"
`
}