Draft
Conversation
Build a cross-platform port-to-PID map from connections to resolve the destination service context for IntraHost connections. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Build a listening port-to-PID map using OS-level APIs (portlist.Poller) on Linux and Windows, with a fallback to connections-based mapping. For IntraHost connections, resolve the destination service context and store it as RemoteServiceTagsIdx on the Connection proto field. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add tagger process tags (service, env, version, tracer metadata) to remote service tags for same-host connections, alongside existing process_context tags from the service extractor. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Cache IIS-specific tags (sitename, app_pool, subsite, service, env, version) from ETW HTTP service events and expose them via a system-probe endpoint so the process-agent can enrich remote service tags on same-host connections. Entries have a 2-minute TTL and are evicted on read. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…lution Expose process cache tags from system-probe via /process_cache_tags endpoint for PID-based tag lookup. For same-host connections, try IIS ETW cache tags first; fall back to process_context, tagger, and process cache tags by destination PID. Limit IIS cache to 1024 entries and only cache local connections. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…lution Move getListeningPortToPIDMap to net_portmap.go (linux || windows) to eliminate duplication. Add getRemoteProcessTags as a platform-specific function: Windows uses process cache from system-probe, Linux uses the tagger. Skip remote tag resolution for containerized connections. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Exercise the platform-specific remote process tag resolution path (getRemoteProcessTags) which was previously untested. The new sub-test provides both procCacheTags (Windows) and processTagProvider (Linux) so it works cross-platform. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remote service tag resolution depends on platform-specific functions (getListeningPortToPIDMap, getRemoteProcessTags) that are not implemented on macOS. Skip the entire test on non-Linux/Windows. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix unsafe type assertion in process_cache.GetAllPIDTags (panic risk) - Use singleton portlist.Poller with cached results instead of creating a new Poller on every collection cycle - Remove inaccurate fallback that mapped ephemeral ports to PIDs; pass portToPID from Run() into batchConnections - Add context.WithTimeout to HTTP fetches in net_windows.go - Replace full-map sweep in storeIISTagsCache with single-entry eviction to avoid latency spikes in the ETW callback path - Make GetIISTagsCache read-only (skip expired entries without deleting) - Replace fmt.Sprintf with strconv in buildIISTags hot path - Remove Windows 'nul' artifact from .gitignore - Add unit tests for GetAllPIDTags and IIS cache internals Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…inux Instead of using the tagger (which requires system-probe's discovery module and only works for APM-instrumented processes), read DD_SERVICE directly from /proc/<pid>/environ so that any process with DD_SERVICE set in its environment is correctly tagged in same-host connection data. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Split the "PID fallback with remote process tags" test: - Common test (net_test.go): asserts service extractor's process_context tag which works on all platforms - net_linux_test.go: tests getRemoteProcessTags reading /proc/environ - net_windows_test.go: tests getRemoteProcessTags using procCacheTags This fixes CI failure where the Linux /proc-based implementation cannot return env:prod/service:web tags that only exist in the test's mock processTagProvider callback (which Linux ignores). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
IIS tags are Windows-only, so move all IIS-related subtests (IIS match, containerized guard, IntraHost guard, no-match) to the Windows test file. Common net_test.go retains only platform-agnostic PID fallback tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…inux getRemoteProcessTags on Linux reads DD_SERVICE from /proc/<pid>/environ and now returns a service: tag instead of process_context:, which was a duplicate of what serviceExtractor.GetServiceContext already provides via cmdline parsing. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add Linux and Windows Python HTTP server e2e tests for process_context remote tags - Use WMI process creation on Windows for detached Python servers that survive SSH cleanup - Use keep-alive connections on both platforms for reliable process context resolution - Make getConnectionStats generic with variadic requiredTagPrefixes - Fix IIS batch2 to not require per-connection IIS tags (cumulative FakeIntake includes expired cache entries) - Merge identical usm-iis.yaml and usm-python.yaml into single usm.yaml - Add service readiness assertions in deploy helpers - Add warm-up and tolerance for agent startup race conditions Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… agent Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix storeIISTagsCache to evict oldest entry when at capacity instead of silently dropping new entries - Add TestHTTPRemoteTagsWindowsSuite to Windows e2e CI - Enable process_service_inference in USM test config for Linux - Refactor IIS test to verify sites sequentially with single-port helpers - Re-comment deployWindowsBinaries/deployLinuxBinaries for CI Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
In CI the agent starts before IIS is installed, so system-probe's IIS ETW provider never initializes. Add an explicit agent restart after IIS and site creation to ensure the ETW tag cache is populated. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
portlist.Poller runs as dd-agent and cannot read /proc/<pid>/fd/ for processes owned by other users, so listening ports are unresolved. Supplement the map from intra-host connection entries provided by system-probe (which runs as root and has the correct server-side PIDs). Also cleans up temporary diagnostic logs and switches Python test to use urllib for HTTP requests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…agent Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Go treats *_windows_test.go as Windows-only. Rename to ec2_1host_wkit_python_test.go so it compiles on Linux CI runners. Also comment out deployLinuxBinaries for CI. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The Windows network tracer retains closed connections for up to 2 minutes (ClientStateExpiry). With the previous 2-minute cache TTL, the final connection report could miss IIS tags when the cache expired at the same time as the connection state. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Helps diagnose IIS keep-alive settings that affect ETW cache TTL requirements for remote service tag resolution. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… support Extract RemoteServiceTagsIdx enrichment logic into a shared remoteservice.Resolver package used by both the process-agent (net.go) and the system-probe direct sender (sender_linux.go). This ensures intra-host connections get remote service tags regardless of which data path is active. Additional changes: - Add CREATE_NO_WINDOW and 30s timeout to PowerShell exec - Delegate buildIISTags to DynamicTags() to avoid duplication - Move platform-specific fetches into fetchRemoteServiceData() - Add concurrency safety documentation to getListeningPortToPIDMap Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…cy-map-logic-same-host-services
…cy-map-logic-same-host-services # Conflicts: # go.sum
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remote service tag enrichment now only applies to intra-host, non-containerized, TCP connections. The portToPID map is also filtered to TCP-only entries at all build sites. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ce-tags-feature Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
Go Package Import DifferencesBaseline: 8f77c3b
|
Contributor
Files inventory check summaryFile checks results against ancestor 8f77c3b8: Results for datadog-agent_7.79.0~devel.git.369.9d3de01.pipeline.105298105-1_amd64.deb:No change detected |
Contributor
Static quality checks❌ Please find below the results from static quality gates Error
Gate failure full details
Static quality gates prevent the PR to merge! Successful checksInfo
9 successful checks with minimal change (< 2 KiB)
On-wire sizes (compressed)
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What does this PR do?
copy of bar.fins/add-dependency-map-logic-same-host-services
Motivation
Describe how you validated your changes
Additional Notes