<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2020 New Relic Corporation. All rights reserved.
SPDX-License-Identifier: Apache-2.0
-->
<extension xmlns="urn:newrelic-extension">
	<instrumentation>

		<tracerFactory name="BulkWriteOperationExecuteWrapper">
			<match assemblyName="MongoDB.Driver" className="MongoDB.Driver.BulkWriteOperation">
				<exactMethodMatcher methodName="Insert"/>
				<exactMethodMatcher methodName="ExecuteHelper"/>
			</match>
		</tracerFactory>

		<tracerFactory name="MongoCollectionDefaultWrapper">
			<match assemblyName="MongoDB.Driver" className="MongoDB.Driver.MongoCollection">
				<exactMethodMatcher methodName="Aggregate"/>
				<exactMethodMatcher methodName="CreateIndex" parameters="MongoDB.Driver.IMongoIndexKeys,MongoDB.Driver.IMongoIndexOptions" />
				<exactMethodMatcher methodName="Drop" />
				<exactMethodMatcher methodName="FindAndModify" parameters="MongoDB.Driver.FindAndModifyArgs" />
				<exactMethodMatcher methodName="FindAndRemove" parameters="MongoDB.Driver.FindAndRemoveArgs" />
				<exactMethodMatcher methodName="GetIndexes" />
				<exactMethodMatcher methodName="IndexExistsByName" />
				<exactMethodMatcher methodName="InitializeOrderedBulkOperation"/>
				<exactMethodMatcher methodName="InitializeUnorderedBulkOperation" />
				<exactMethodMatcher methodName="ParallelScanAs" parameters="MongoDB.Driver.ParallelScanArgs"/>
				<exactMethodMatcher methodName="Save" parameters="System.Type,System.Object,MongoDB.Driver.MongoInsertOptions"/>
				<exactMethodMatcher methodName="Update" parameters="MongoDB.Driver.IMongoQuery,MongoDB.Driver.IMongoUpdate,MongoDB.Driver.MongoUpdateOptions"/>
				<exactMethodMatcher methodName="Validate" parameters="MongoDB.Driver.ValidateCollectionArgs"/>
			</match>
		</tracerFactory>

		<tracerFactory name="MongoCollectionFindWrapper">
			<match assemblyName="MongoDB.Driver" className="MongoDB.Driver.MongoCollection">
				<exactMethodMatcher methodName="FindAs"/>
				<exactMethodMatcher methodName="FindOneAs" parameters="MongoDB.Driver.FindOneArgs" />
			</match>
		</tracerFactory>

		<tracerFactory name="MongoCollectionInsertWrapper">
			<match assemblyName="MongoDB.Driver" className="MongoDB.Driver.MongoCollection">
				<exactMethodMatcher methodName="InsertBatch" parameters="System.Type,System.Collections.IEnumerable,MongoDB.Driver.MongoInsertOptions" />
			</match>
		</tracerFactory>

		<tracerFactory name="MongoCollectionRemoveWrapper">
			<match assemblyName="MongoDB.Driver" className="MongoDB.Driver.MongoCollection">
				<exactMethodMatcher methodName="Remove" parameters="MongoDB.Driver.IMongoQuery,MongoDB.Driver.RemoveFlags,MongoDB.Driver.WriteConcern"/>
			</match>
		</tracerFactory>

		<tracerFactory name="MongoCursorWrapper">
			<match assemblyName="MongoDB.Driver" className="MongoDB.Driver.MongoCursor`1">
				<exactMethodMatcher methodName="GetEnumerator" />
			</match>
		</tracerFactory>

		<tracerFactory name="MongoDatabaseDefaultWrapper">
			<match assemblyName="MongoDB.Driver" className="MongoDB.Driver.MongoDatabase">
				<exactMethodMatcher methodName="CreateCollection" parameters="System.String,MongoDB.Driver.IMongoCollectionOptions"/>
			</match>
		</tracerFactory>

	</instrumentation>
</extension>
