Skip to content

feat(apm): add APM Services/Entities API support#22

Merged
platinummonkey merged 1 commit into
mainfrom
majorgreys/apm-api-support
Feb 10, 2026
Merged

feat(apm): add APM Services/Entities API support#22
platinummonkey merged 1 commit into
mainfrom
majorgreys/apm-api-support

Conversation

@majorgreys
Copy link
Copy Markdown
Contributor

Summary

Implements 7 new APM commands for querying services, entities, dependencies, and service flow maps:

  • pup apm services list - List all APM services
  • pup apm services stats - Get service performance statistics
  • pup apm services operations <service> - List operations for a service
  • pup apm services resources <service> - List resources (endpoints) for a service+operation
  • pup apm entities list - List APM entities with rich metadata
  • pup apm dependencies list [service] - View service dependencies
  • pup apm flow-map - Service flow map with performance metrics

All commands use the RawRequest pattern due to limited SDK support for APM APIs. The implementation follows patterns established in cmd/investigations.go for API calls outside the official SDK.

Test Plan

  • All unit tests pass (go test ./cmd/...)
  • Commands build successfully (go build)
  • Integration tested against staging environment (datad0g.com)
  • All 7 commands tested with various flag combinations (20+ test scenarios)
  • Output formats verified (JSON, YAML, table)
  • Error handling verified (missing flags, invalid parameters, auth errors)
  • Documentation updated (README.md, COMMANDS.md, CHANGELOG.md)
  • .envrc added to .gitignore to prevent committing staging credentials

Coverage

Test coverage matches existing command patterns: 77.9% on init functions, 0% on API call functions (consistent with other commands like monitors.go)

🤖 Generated with Claude Code

Implements 7 new APM commands for querying services, entities, dependencies,
and service flow maps:
- pup apm services (list, stats, operations, resources)
- pup apm entities list
- pup apm dependencies list [service]
- pup apm flow-map

All commands use RawRequest pattern due to limited SDK support. Includes
comprehensive tests and documentation updates.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@majorgreys majorgreys requested a review from a team as a code owner February 10, 2026 17:41
@github-actions
Copy link
Copy Markdown

📊 Test Coverage Report

Overall Coverage: 80.4% Coverage

Threshold: 80% ✅

Coverage by Package
## Coverage by Package

- github.com/DataDog/pup/pkg/auth/callback/server.go:40: 81.2%
- github.com/DataDog/pup/pkg/auth/dcr/client.go:28: 100.0%
- github.com/DataDog/pup/pkg/auth/dcr/types.go:24: 100.0%
- github.com/DataDog/pup/pkg/auth/oauth/client.go:22: 100.0%
- github.com/DataDog/pup/pkg/auth/oauth/pkce.go:24: 85.7%
- github.com/DataDog/pup/pkg/auth/storage/factory.go:53: 94.7%
- github.com/DataDog/pup/pkg/auth/storage/keychain.go:44: 42.9%
- github.com/DataDog/pup/pkg/auth/storage/storage.go:58: 71.4%
- github.com/DataDog/pup/pkg/auth/types/types.go:23: 100.0%
- github.com/DataDog/pup/pkg/client/client.go:32: 94.4%
- github.com/DataDog/pup/pkg/config/config.go:22: 100.0%
- github.com/DataDog/pup/pkg/formatter/formatter.go:31: 100.0%
- github.com/DataDog/pup/pkg/useragent/useragent.go:32: 100.0%
- github.com/DataDog/pup/pkg/util/time.go:20: 95.8%

## Summary

total:								(statements)		80.4%

📈 Coverage Status: ✅ PASSED - Coverage meets minimum threshold

Updated for commit a40d11d

@platinummonkey platinummonkey merged commit 7684871 into main Feb 10, 2026
4 checks passed
@platinummonkey platinummonkey deleted the majorgreys/apm-api-support branch February 10, 2026 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants