generated from honeycombio/.github
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Which problem is this PR solving? - connection refused when trying to access port 6060 ## Short description of the changes - adjust hard-coded address from `localhost:6060` to `0.0.0.0:6060` - add local testing setup for using pyroscope ## How to verify that this has the expected result Uncomment the pyroscope pieces in `deployment.yaml` and `DEBUG=true`. ```sh make docker-build make apply-pyroscope-server export POD_NAME=$(kubectl get pods --namespace default -l "app.kubernetes.io/name=pyroscope,app.kubernetes.io/instance=pyroscope" -o jsonpath="{.items[0].metadata.name}") export CONTAINER_PORT=$(kubectl get pod --namespace default $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") kubectl --namespace default port-forward $POD_NAME 4040:$CONTAINER_PORT make apply-agent ``` navigate to `http://localhost:4040/` and see scrape targets with health up and details of last scrape. Go to Continuous Profiling / Tag Explorer to see flamegraph.
- Loading branch information
1 parent
6ca7d87
commit 807af2a
Showing
5 changed files
with
95 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
--- | ||
image: | ||
repository: pyroscope/pyroscope | ||
tag: 0.33.0 | ||
pullPolicy: IfNotPresent | ||
# Create Cluster Role and bind it to Pyroscope to enable it watching Kubernetes resources. | ||
rbac: | ||
create: true | ||
# Pyroscope configuration. | ||
pyroscopeConfigs: | ||
log-level: debug | ||
scrape-configs: | ||
# Example scrape config for pods | ||
# | ||
# The relabeling allows the actual pod scrape endpoint to be configured via the | ||
# following annotations: | ||
# | ||
# * `pyroscope.io/scrape`: Only scrape pods that have a value of `true`. | ||
# * `pyroscope.io/application-name`: Name of the application being profiled. | ||
# * `pyroscope.io/scheme`: If the metrics endpoint is secured then you will need | ||
# to set this to `https` & most likely set the `tls_config` of the scrape config. | ||
# * `pyroscope.io/port`: Scrape the pod on the indicated port. | ||
# * `pyroscope.io/profile-{profile_name}-path`: Specifies URL path exposing pprof profile. | ||
# * `pyroscope.io/profile-{profile_name}-param-{param_key}`: Overrides scrape URL parameters. | ||
# | ||
# Kubernetes labels will be added as Pyroscope labels on metrics via the | ||
# `labelmap` relabeling action. | ||
- job-name: 'kubernetes-pods' | ||
enabled-profiles: [cpu, mem] | ||
kubernetes-sd-configs: | ||
- role: pod | ||
relabel-configs: | ||
- source-labels: [__meta_kubernetes_pod_annotation_pyroscope_io_scrape] | ||
action: keep | ||
regex: true | ||
- source-labels: | ||
[__meta_kubernetes_pod_annotation_pyroscope_io_application_name] | ||
action: replace | ||
target-label: __name__ | ||
- source-labels: | ||
[__meta_kubernetes_pod_annotation_pyroscope_io_spy_name] | ||
action: replace | ||
target-label: __spy_name__ | ||
- source-labels: [__meta_kubernetes_pod_annotation_pyroscope_io_scheme] | ||
action: replace | ||
regex: (https?) | ||
target-label: __scheme__ | ||
- source-labels: | ||
[__address__, __meta_kubernetes_pod_annotation_pyroscope_io_port] | ||
action: replace | ||
regex: ([^:]+)(?::\d+)?;(\d+) | ||
replacement: $1:$2 | ||
target-label: __address__ | ||
- action: labelmap | ||
regex: __meta_kubernetes_pod_label_(.+) | ||
- source-labels: [__meta_kubernetes_namespace] | ||
action: replace | ||
target-label: kubernetes_namespace | ||
- source-labels: [__meta_kubernetes_pod_name] | ||
action: replace | ||
target-label: kubernetes_pod_name | ||
- source-labels: [__meta_kubernetes_pod_phase] | ||
regex: Pending|Succeeded|Failed|Completed | ||
action: drop | ||
- action: labelmap | ||
regex: __meta_kubernetes_pod_annotation_pyroscope_io_profile_(.+) | ||
replacement: __profile_$1 |