-
Notifications
You must be signed in to change notification settings - Fork 980
rec: add REST interface for manipulating Open Telemetry Trace Conditions #16727
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
+492
−10
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
108aaf8
rec: OTTrace REST management: list all conditions
omoerbeek 435c000
add getting detail of specific OT Condition, keyed by netmask
omoerbeek acd8fda
Fix case where there are ot conditions, but none matches
omoerbeek 49ed5d9
Implement OT conditions REST delete call
omoerbeek c22b562
Implement REST put otcondition
omoerbeek 00eb65d
Cleanup things a bit, use POST for new OT conditions
omoerbeek d471af3
Add test and fix transition from empty to non empty conditions list
omoerbeek 9f12c28
Docs and tweaks
omoerbeek 446f83c
Encode subnets not a a single path component, but as id/prefixlen as …
omoerbeek 2fca888
Apply suggestions from code review
omoerbeek bf93257
Revert default location of recursur, will move to a separate PR
omoerbeek 5034ece
Better words on docs
omoerbeek 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -979,6 +979,7 @@ oskar | |
| otherdomain | ||
| otherpool | ||
| othervariant | ||
| ottracecondition | ||
| ourname | ||
| ourserial | ||
| outpacket | ||
|
|
||
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
32 changes: 32 additions & 0 deletions
32
pdns/recursordist/docs/http-api/endpoint-ottraceconditions.rst
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,32 @@ | ||
| OpenTelemetryTraceConditions endpoint | ||
| ===================================== | ||
|
|
||
| .. Note:: | ||
| All modifications using this endpoint are not persistent. | ||
| Reloading the configuration using ``rec_control reload-yaml`` will revert the trace conditions back to the conditions read from the configuration file(s). | ||
|
|
||
| .. http:get:: /api/v1/servers/:server_id/ottraceconditions | ||
|
|
||
| Get all :json:object:`OpenTelemetryTraceCondition` from the server. Note that while the settings file allows a list of subnets to be associated with a condition, this list will be flattened, with only one subnet per condition. | ||
|
|
||
| :query server_id: The name of the server | ||
|
|
||
| .. http:post:: /api/v1/servers/:server_id/ottraceconditions | ||
|
|
||
| Creates a new trace condition. The client body must contain a :json:object:`OpenTelemetryTraceCondition`. | ||
|
|
||
| :query server_id: The name of the server | ||
|
|
||
| .. http:get:: /api/v1/servers/:server_id/ottraceconditions/:ip/:prefixlen | ||
|
|
||
| Returns trace condition information. | ||
|
|
||
| :query server_id: The name of the server | ||
| :query ip/prefixlen: The subnet of the :json:object:`OpenTelemetryTraceCondition`. | ||
|
|
||
| .. http:delete:: /api/v1/servers/:server_id/ottraceconditions/:ip/:prefixlen | ||
|
|
||
| Deletes this zone, all attached metadata and rrsets. | ||
|
|
||
| :query server_id: The name of the server | ||
| :query ip/prefixlen: The subnet of the :json:object:`OpenTelemetryTraceCondition`. |
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,32 @@ | ||
| OpenTelemetryTraceCondition | ||
| --------------------------- | ||
|
|
||
| An ``OpenTelemetryTraceCondition`` object represents a condition to trigger generating :ref:`opentelemetry_tracing`. | ||
| These conditions con be configured in a settings file (see :ref:`setting-yaml-logging.opentelemetry_trace_conditions`) or manipulated at runtime using the REST API calls listed in :doc:`endpoint-ottraceconditions`. | ||
|
|
||
| .. json:object:: OpenTelemetryTraceCondition | ||
|
|
||
| Represents an OpenTelemetryTrace condition. | ||
|
|
||
| :property string acl: The subnet of the entry. Note that the YAML settings file allows multiple subnets for convenience. This object does not allow multiple subnets to be specified. | ||
| :property string type: set to "OpenTelemetryTraceCondition" | ||
| :property bool edns_option_required: See :ref:`opentelemetry_tracing` | ||
| :property number qid: A specific query id | ||
| :property [DNSName] qnames: List of names | ||
| :property [QType] qtypes: List of qtypes, represented as string | ||
| :property bool traceid_only: See :ref:`opentelemetry_tracing` | ||
|
|
||
| **Example**: | ||
|
|
||
| .. code-block:: json | ||
|
|
||
| { | ||
| "acl": "192.0.2.1/32", | ||
| "edns_option_required": false, | ||
| "qid": 1, | ||
| "qnames": ["example.com.", "example.net."], | ||
| "qtypes": ["AAAA", "A"], | ||
| "traceid_only": false | ||
| "type": "OpenTelemetryTraceCondition" | ||
| } | ||
|
|
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.
Uh oh!
There was an error while loading. Please reload this page.