Module: ScoutApmMcp::Client::Api::Endpoints
- Included in:
- ScoutApmMcp::Client
- Defined in:
- lib/scout_apm_mcp/client/api.rb
Instance Method Summary collapse
- #get_endpoint_metrics(app_id, endpoint_id, metric_type, from: nil, to: nil, range: nil) ⇒ Object
- #list_endpoint_traces(app_id, endpoint_id, from: nil, to: nil, range: nil) ⇒ Object
- #list_endpoints(app_id, from: nil, to: nil, range: nil, sort_by: nil, limit: nil, offset: nil) ⇒ Object
Instance Method Details
#get_endpoint_metrics(app_id, endpoint_id, metric_type, from: nil, to: nil, range: nil) ⇒ Object
53 54 55 56 57 58 59 60 61 |
# File 'lib/scout_apm_mcp/client/api.rb', line 53 def get_endpoint_metrics(app_id, endpoint_id, metric_type, from: nil, to: nil, range: nil) times = resolve_range_times(from: from, to: to, range: range) validate_metric_params(metric_type, times[:from], times[:to]) uri = api_uri("apps", app_id, "endpoints", endpoint_id, "metrics", metric_type) assign_query(uri, from: times[:from], to: times[:to]) response = make_request(uri) series = response.dig("results", "series") || {} series[metric_type] || [] end |
#list_endpoint_traces(app_id, endpoint_id, from: nil, to: nil, range: nil) ⇒ Object
63 64 65 66 67 68 69 70 |
# File 'lib/scout_apm_mcp/client/api.rb', line 63 def list_endpoint_traces(app_id, endpoint_id, from: nil, to: nil, range: nil) times = resolve_range_times(from: from, to: to, range: range) validate_trace_time_range(times[:from], times[:to]) uri = api_uri("apps", app_id, "endpoints", endpoint_id, "traces") assign_query(uri, from: times[:from], to: times[:to]) response = make_request(uri) response.dig("results", "traces") || [] end |
#list_endpoints(app_id, from: nil, to: nil, range: nil, sort_by: nil, limit: nil, offset: nil) ⇒ Object
43 44 45 46 47 48 49 50 51 |
# File 'lib/scout_apm_mcp/client/api.rb', line 43 def list_endpoints(app_id, from: nil, to: nil, range: nil, sort_by: nil, limit: nil, offset: nil) times = resolve_listing_time_range(from: from, to: to, range: range) validate_sort_by!(sort_by) uri = URI("#{@api_base}/apps/#{app_id}/endpoints") assign_query(uri, from: times[:from], to: times[:to], sort_by: sort_by, limit: limit, offset: offset) response = make_request(uri) endpoint_listing_results(response, sort_by: sort_by, limit: limit, offset: offset) end |