grafana / pyroscope

Continuous Profiling Platform. Debug performance issues down to a single line of code
https://grafana.com/oss/pyroscope/
GNU Affero General Public License v3.0
9.79k stars 583 forks source link

Does `ec2-sd-configs` for ec2 in another account is supported ? #1057

Closed futurelm closed 2 years ago

futurelm commented 2 years ago

in short, AWS EC2 instances are under the main AWS account, and pyroscope server is running in another AWS account. in this case, this is the scrape-configs

- enabled-profiles: [ cpu, mem ]
  job-name: stg-food-max-dataservice
  ec2-sd-configs:
  - region: ap-southest-1
    role_arn: arn:aws:iam::MAIN_ACCOUNT:role/ec2-readonly-role
    port: 8089
    filters:
    - name: tag:Cluster
      values:
      - stg
    - name: tag:App_Name
      values:
      - food
  relabel-configs:
  - source-labels: [__meta_ec2_private_ip]
    target-label: instance
  - source-labels: [__meta_ec2_tag_App_Name]
    target-label: app_name

why does it can work? can't see error log, but can't find the target in web UI

petethepig commented 2 years ago

@futurelm The problem is that currently we only support 2 service discovery methods:

Here's some docs on this topic.

We do not currently have support for AWS service discovery. For now I’d recommend using static service discovery as a workaround. We’ll eventually add AWS service discovery, but I don’t have a timeline for you at this time. We’d also accept any open source contributions related to this if you want to help out!

petethepig commented 2 years ago

Implemented in https://github.com/pyroscope-io/pyroscope/pull/1165

Thank you @futurelm !