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

jfr parser ParseEvent error: error reading CP: unknown type 0 @ <offset> #2861

Open
Sreenitti opened this issue Feb 27, 2025 · 0 comments
Open
Labels
bug Something isn't working

Comments

@Sreenitti
Copy link

What's wrong?

I have a java service running on a kubernetes cluster. I am trying to profile it by setting up java profiling using grafana alloy (auto-instrumentation through alloy). I am getting the following error in the pyroscope.java component
"failed to reset: failed to parse jfr: jfr parser ParseEvent error: error reading CP: unknown type 0 @ 12041"
Image

Steps to reproduce

Followed the steps in

  1. Set up Java profiling using Grafana Alloy
  2. pyroscope.java | Grafana Agent documentation

System information

No response

Software version

Grafana alloy v1.7.0

Configuration

discovery.kubernetes "local_pods" {
  selectors {
    field = "spec.nodeName=" + env("HOSTNAME")
    role = "pod"
  }
  role = "pod"
}
discovery.process "all" {
  discover_config {
    cwd = true
    exe = true
    commandline = true
    username = true
    uid = true
    container_id = true
  }
  join = discovery.kubernetes.local_pods.targets
}
discovery.relabel "java_pods" {
  targets = discovery.process.all.targets
  rule {
    source_labels = ["__meta_process_exe"]
    action = "keep"
    regex = ".*/java$"
  }
  rule {
    action = "drop"
    regex = "Succeeded|Failed|Completed"
    source_labels = ["__meta_kubernetes_pod_phase"]
  }
  rule {
    action = "replace"
    source_labels = ["__meta_kubernetes_namespace"]
    target_label = "namespace"
  }
  rule {
    action = "replace"
    source_labels = ["__meta_kubernetes_pod_name"]
    target_label = "pod"
  }
  rule {
    action = "replace"
    source_labels = ["__meta_kubernetes_pod_node_name"]
    target_label = "node"
  }
  rule {
    action = "replace"
    source_labels = ["__meta_kubernetes_pod_container_name"]
    target_label = "container"
  }
  rule {
    action = "replace"
    source_labels = ["__meta_kubernetes_pod_container_name"]
    target_label = "service_name"
  }
  rule {
    action = "replace"
    regex = "(.*)@(.*)"
    replacement = "${1}/${2}"
    separator = "@"
    source_labels = ["__meta_kubernetes_namespace", "__meta_kubernetes_pod_container_name"]
    target_label = "ns_service_name"
  }
  rule {
    action = "keep"
    regex = "^java-service-auto$"
    source_labels = ["service_name"]
  }
}

pyroscope.java "java" {
  forward_to = [pyroscope.write.backend.receiver]
  targets = discovery.relabel.java_pods.output
  profiling_config {
    interval = "10s"
    alloc = "512k"
    cpu = true
    lock = "10ms"
    sample_rate = 100
  }
}
livedebugging{
    enabled=true
}
pyroscope.write "backend" {
        endpoint {
                url = "http://pyroscope.pyroscope-test.svc.cluster.local:4040"
        }
}

Logs

ts=2025-02-27T03:46:02.973354716Z level=debug msg="jfr file read" component_path=/ component_id=pyroscope.java.java pid=2637421 len=12279
ts=2025-02-27T03:46:02.973752534Z level=error component_path=/ component_id=pyroscope.java.java pid=2637421 err="failed to reset: failed to parse jfr: jfr parser ParseEvent error: error reading CP: unknown type 0 @ 12041"
ts=2025-02-27T03:46:02.973789846Z level=debug component_path=/ component_id=pyroscope.java.java pid=2637421 cmd="/tmp/alloy-asprof-1647b45f053a8c61b01681af44d4b870cf622146/bin/asprof -f /tmp/asprof-2631464-2637421.jfr -o jfr -e itimer -i 10000000 --alloc 512k --lock 10ms start --timeout 10 2637421"
@Sreenitti Sreenitti added the bug Something isn't working label Feb 27, 2025
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

1 participant