kezhenxu94 commented on issue #7226:
URL: https://github.com/apache/skywalking/issues/7226#issuecomment-872686226


   - If you want to see self observability metrics in SkyWalking UI, you need 
to use a Prometheus and relabel the instances with Kubernetes Pod metadata and 
labels, and then activate `otel-oc-rules/oap.yaml` to fetch from prometheus 
into OAP.
   - If you want to see self observability metrics in Grafana, set up a 
Prometheus and Grafana, import our Grafana settings 
https://github.com/apache/skywalking/blob/a396888de804a8f7090db70e6a2b7879684c4bf0/docs/en/setup/backend/grafana-cluster.json
 
https://github.com/apache/skywalking/blob/a396888de804a8f7090db70e6a2b7879684c4bf0/docs/en/setup/backend/grafana-instance.json
   
   Here is an example of Prometheus config
   
   ```yaml
   global:
     scrape_interval: 15s
     evaluation_interval: 15s
     scrape_timeout: 10s
   
   scrape_configs:
     - job_name: 'prometheus-self'
       scrape_interval: 5s
       static_configs:
         - targets: [ 'localhost:9090' ]
   
     - job_name: 'oap'
         kubernetes_sd_configs:
           - role: pod
         relabel_configs:
           - source_labels: [ 
__meta_kubernetes_pod_annotation_prometheus_io_scrape ]
             action: keep
             regex: true
           - source_labels: [ 
__meta_kubernetes_pod_annotation_prometheus_io_path ]
             action: replace
             target_label: __metrics_path__
             regex: (.+)
           - source_labels: [ __address__, 
__meta_kubernetes_pod_annotation_prometheus_io_port ]
             action: replace
             regex: ([^:]+)(?::\d+)?;(\d+)
             replacement: $1:$2
             target_label: __address__
           - source_labels: [ 
__meta_kubernetes_pod_annotation_prometheus_io_scheme ]
             action: replace
             target_label: __scheme__
             regex: (.+)
   ```
   
   You also need to put annotations in your OAP pods:
   
   ```yaml
   prometheus.io/path: /metrics
   prometheus.io/port: "1234"  
   prometheus.io/scheme: http  
   prometheus.io/scrape: "true"
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to