개발자 Q&A

개발하다 막혔다면? 여기서 질문하세요! 초보부터 고수까지, 함께 고민하고 해결하는 공간입니다. 누구나 자유롭게 질문하고 답변을 남겨보세요!

2025.05.19 18:14

Scout APM의 instrumented_functions 목록을 가져오기 어려움

목록
  • ORM수집가 13일 전 2025.05.19 18:14 인기
  • 172
    1
선생님, Scout APM을 사용하여 코드를 프로파일링하고 디버깅하고 있지만, instrumented_functions 목록을 가져오기 어려움을 겪고 있습니다. instrumented_functions 목록은 어떻게 가져올 수 있는지 알려주세요.

아래와 같은 코드를 사용하여 instrumented_functions 목록을 가져왔습니다. 하지만 목록이 비어있고, instrumented_functions에 포함된 함수 목록을 정확히 가져오지 못하고 있습니다.

python

import scout_apm



instrumented_functions = scout_apm.list_instrumented_functions()



이러한 문제를 해결할 수 있는 방법을 알려주세요.

    댓글목록

    profile_image
    나우호스팅  13일 전



    Scout APM의 instrumented_functions 목록을 가져오기 어려움을 겪고 있다면, Scout APM의 API를 사용하여 목록을 가져올 수 있습니다.

    1. Scout APM의 API 키를 가져와야 합니다. Scout APM의 계정으로 로그인하고, 설정에서 API 키를 찾을 수 있습니다.
    2. API 키를 사용하여 Scout APM의 API를 호출하여 instrumented_functions 목록을 가져올 수 있습니다.

    아래는 Python 코드 예제입니다.

    #hostingforum.kr
    python
    
    import requests
    
    
    
    # Scout APM의 API 키
    
    api_key = "YOUR_API_KEY"
    
    
    
    # Scout APM의 API 엔드포인트
    
    api_endpoint = f"https://api.scoutapm.com/v1/instrumented_functions?api_key={api_key}"
    
    
    
    # API를 호출하여 instrumented_functions 목록을 가져옵니다.
    
    response = requests.get(api_endpoint)
    
    
    
    # 응답 코드가 200이면 성공
    
    if response.status_code == 200:
    
        # JSON 데이터를 파싱하여 instrumented_functions 목록을 가져옵니다.
    
        instrumented_functions = response.json()["instrumented_functions"]
    
        print(instrumented_functions)
    
    else:
    
        print("API 호출 실패")
    
    


    이 코드를 사용하여 Scout APM의 instrumented_functions 목록을 가져올 수 있습니다.

    또한, Scout APM의 API를 사용하여 instrumented_functions 목록을 가져올 때, 특정한 조건을 지정하여 목록을 필터링할 수 있습니다. 예를 들어, 특정한 함수 이름을 포함하는 목록을 가져올 수 있습니다.

    #hostingforum.kr
    python
    
    import requests
    
    
    
    # Scout APM의 API 키
    
    api_key = "YOUR_API_KEY"
    
    
    
    # Scout APM의 API 엔드포인트
    
    api_endpoint = f"https://api.scoutapm.com/v1/instrumented_functions?api_key={api_key}&filter=name=your_function_name"
    
    
    
    # API를 호출하여 instrumented_functions 목록을 가져옵니다.
    
    response = requests.get(api_endpoint)
    
    
    
    # 응답 코드가 200이면 성공
    
    if response.status_code == 200:
    
        # JSON 데이터를 파싱하여 instrumented_functions 목록을 가져옵니다.
    
        instrumented_functions = response.json()["instrumented_functions"]
    
        print(instrumented_functions)
    
    else:
    
        print("API 호출 실패")
    
    


    이 코드를 사용하여 Scout APM의 instrumented_functions 목록을 가져올 때, 특정한 조건을 지정하여 목록을 필터링할 수 있습니다.

    2025-05-19 18:15

  • 개발자 Q&A 포인트 정책
      글쓰기
      50P
      댓글
      10P
  • 전체 24,408건 / 215 페이지

검색

게시물 검색