-
Notifications
You must be signed in to change notification settings - Fork 1
feat: add Dynatrace integration #282
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| # Dynatrace | ||
|
|
||
| pncli uses Dynatrace's REST APIs directly; no Dynatrace CLI is required. | ||
|
|
||
| ## Configuration | ||
|
|
||
| | Key | Environment variable | Purpose | | ||
| |---|---|---| | ||
| | `dynatrace.baseUrl` | `PNCLI_DYNATRACE_BASE_URL` | Classic environment URL, such as `https://abc12345.live.dynatrace.com` | | ||
| | `dynatrace.apiToken` | `PNCLI_DYNATRACE_API_TOKEN` | Environment API token with `entities.read` and `problems.read` | | ||
| | `dynatrace.platformUrl` | `PNCLI_DYNATRACE_PLATFORM_URL` | Optional latest-platform URL, such as `https://abc12345.apps.dynatrace.com` | | ||
| | `dynatrace.platformToken` | `PNCLI_DYNATRACE_PLATFORM_TOKEN` | Optional platform token with permission to query spans in Grail | | ||
|
|
||
| The Environment API token supports entities, services, Kubernetes workloads, and problems. Distributed | ||
| trace data is stored in Grail and requires the separate latest-platform URL and Bearer platform token. | ||
| The classic `traces.lookup` scope only checks whether a trace exists for cross-environment tracing and | ||
| does not grant an API for retrieving its spans. | ||
|
|
||
| ```bash | ||
| pncli config set dynatrace.baseUrl https://abc12345.live.dynatrace.com | ||
| pncli config set dynatrace.apiToken dt0c01... | ||
| pncli config set dynatrace.platformUrl https://abc12345.apps.dynatrace.com | ||
| pncli config set dynatrace.platformToken dt0s16... | ||
| pncli config test | ||
| ``` | ||
|
|
||
| When platform credentials are present, `config test` and `config check` also run a minimal Grail | ||
| spans query and report it separately as `dynatrace_platform`. | ||
|
|
||
| ## Commands | ||
|
|
||
| ```bash | ||
| pncli dynatrace services --from now-2h | ||
| pncli dynatrace workloads --from now-2h | ||
| pncli dynatrace entities list --selector 'type("HOST")' | ||
| pncli dynatrace entities get --id SERVICE-1234567890ABCDEF | ||
|
|
||
| pncli dynatrace problems list --from now-24h | ||
| pncli dynatrace problems list --problem-selector 'status("OPEN")' | ||
| pncli dynatrace problems get --id 1234567890_1234567890V2 | ||
|
|
||
| pncli dynatrace trace --id 0123456789abcdef0123456789abcdef | ||
| ``` | ||
|
|
||
| Entity and problem list commands automatically follow Dynatrace pagination. Use Dynatrace selector | ||
| syntax for advanced filtering. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Security note —
workflows: writeis a meaningful permission escalation for an automated agent processing untrusted inputThe triage agent now has the ability to modify
.github/workflows/files. The prompt already includes strong anti-injection guardrails (explicit untrusted-input framing, allow-list for when workflow edits are permitted, security assessment gate), so the risk is mitigated in practice.Worth keeping in mind: this is the permission most valuable to an adversary trying to exploit a prompt-injection attack via a crafted issue body. If you see an issue that requests a workflow change and whose body contains anything suspicious, double-check the resulting commit carefully before merging. The existing "modify workflow or CI files only when the issue explicitly requests..." guardrail in the prompt is the main control here.