Repository navigation
Link APM applications to DocumentDB instance endpoints (staging) - #3351
Open
nr-ahemsath wants to merge 1 commit into
Open
nr-ahemsath wants to merge 1 commit into
nr-ahemsath wants to merge 1 commit into
Conversation
Agents that report the server the MongoDB driver talked to (Java and Python with topology discovery) report the DocumentDB instance endpoint, e.g. <instance>.<hash>.<region>.docdb.amazonaws.com. With a metric-streams AWS integration, instance entities carry no endpoint, port or identifier tags, so every AWSDOCUMENTDB lookup tier misses. Staging-only overrides: - synthesis: capture instanceName and region from instance-endpoint hostnames. Cluster (cluster-*) and reader (cluster-ro-*) endpoints are excluded. - candidates: new Tier 4 matching INFRA-AWSDOCDBINSTANCE on tags.displayName + region (as AWSMSKCLUSTER and AWSSQSQUEUE do). The instance-ID tier becomes Tier 5, unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Relevant information
Follow-up to #3323 and #3332. APM → DocumentDB links form when the agent reports the DocumentDB cluster endpoint, but not when it reports an instance endpoint.
What we found: we tested the .NET, Java and Python agents against the same single-instance DocumentDB cluster in staging (account 273070). In topology-discovery mode (the driver default), the Java agent (9.5.0, mongodb-driver-sync 5.5.2) and the Python agent (14.2.0, pymongo 4.19.0) report the instance endpoint, e.g.
Those apps get no
CALLSrelationship. The same apps in direct-connection mode, and the .NET agent in both modes, report the cluster endpoint and link to the cluster entity.Why: with a CloudWatch metric-streams AWS integration,
INFRA-AWSDOCDBINSTANCEentities carry onlyaws.Arn,aws.Engine, account, region and AZ tags, plusdisplayName(the instance identifier). They have no endpoint, port, cluster-identifier or instance-identifier tags. So everyAWSDOCUMENTDBtier misses for an instance endpoint. Tier 4 extracts the rightinstanceId(dotnet-docdb-test-1) but looks it up intags.aws.rds.DBInstanceIdentifier/tags.aws.dbInstanceIdentifier, which aren't present.Change (staging only): adds
.stg.ymloverrides of the candidate and synthesis files. The production files are untouched.synthesis/APM-APPLICATION-to-AWSDOCUMENTDB.stg.yml: two new fields,instanceNameandregion, captured from the first and third hostname labels. They're captured only when the second label has no hyphen, so instance endpoints (<instance>.<hash>.<region>.docdb.amazonaws.com) match, and cluster (cluster-<hash>) and reader (cluster-ro-<hash>) endpoints don't.candidates/AWSDOCUMENTDB.stg.yml: a new Tier 4 that matchesINFRA-AWSDOCDBINSTANCEontags.displayName=instanceNameandtags.aws.awsRegion/tags.aws.region=region, withonMiss: NO_OP. It follows thedisplayName+ region lookups inAWSMSKCLUSTER.ymlandAWSSQSQUEUE.yml. The existing instance-ID tier becomes Tier 5, unchanged.Precision: the datastore metric carries no AWS account ID, so the new tier can't match on account. Two linked AWS accounts with an instance of the same name in the same region would both be related. The existing instance-ID tier already has the same limitation.
Validation:
npm --prefix validator run checkpasses. Staging validation: after deploy, confirmCALLSrelationships fromJavaDocDbTest-InVpc-DiscoveryandPythonDocDbTest-InVpc-Discoveryto thedotnet-docdb-test-1instance entity, and confirm that the existing cluster links are unchanged.TBD: if this works in staging, I'll follow up with a PR that promotes the change to production and removes the
.stgfiles.Api Review Board (ARB)
This does not need an ARB ticket.
Checklist
identifierwill be unique and valid.🤖 Generated with Claude Code