Skip to content

Commit

Permalink
Merge Kafka branch into Main (#130)
Browse files Browse the repository at this point in the history
* Kafka instrumentation part 1 - Sample application (#123)

* Kafka instrumentation part 2 - Integration test (#125)

* Add basic Produce and Consume instrumentation (#127)

* Refactor kafka sample app

* Add kafka produce method instrumentation

* Move kafka produce instrumentation to new kafka directory

* Move constants to separate class

* Add Kafka integration for Consume method

* Refactor property retrieving in Produce integration

* Refactor Kafka integration

* Move tag names to Tags class

* Remove unnecessary file; change sample to match already covered methods

* Fix versions; generate integrations.json

* Add log on entering the intercepting methods

* Fix type names

* Fix tags names

* Remove caller assembly restriction

* Fix Kafka interfaces (#3)

* Signature fixes: use interface instead of concrete type

* Fix Consume method signature

* Fix header passing and property retrieval

* Add header creation if null

* Fix context propagation on consumer side

* Add commit to already read messages in sample app

* Move scope creation to helper class

* Add integration of Produce overload with string topic

* Refactor Produce instrumentation

* Add integrations.json for new Produce methdo integration

* Add integration for Consume with CancellationToken parameter

* Add integrations.json

* Refactor Consume instrumentation

* Add instrumentation to ProduceAsync methods

* Kafka instrumentation part 1 - Sample application (#123)

* Kafka instrumentation part 2 - Integration test (#125)

* Refactor kafka sample app

* Add kafka produce method instrumentation

* Move kafka produce instrumentation to new kafka directory

* Move constants to separate class

* Add Kafka integration for Consume method

* Refactor property retrieving in Produce integration

* Refactor Kafka integration

* Move tag names to Tags class

* Remove unnecessary file; change sample to match already covered methods

* Fix versions; generate integrations.json

* Add log on entering the intercepting methods

* Fix type names

* Fix tags names

* Remove caller assembly restriction

* Fix Kafka interfaces (#3)

* Signature fixes: use interface instead of concrete type

* Fix Consume method signature

* Fix header passing and property retrieval

* Add header creation if null

* Fix context propagation on consumer side

* Add commit to already read messages in sample app

* Move scope creation to helper class

* Add integration of Produce overload with string topic

* Refactor Produce instrumentation

* Add integrations.json for new Produce methdo integration

* Add integration for Consume with CancellationToken parameter

* Add integrations.json

* Refactor Consume instrumentation

* Add instrumentation to ProduceAsync methods

* Refactor Consume integration

* Refactor ProducKafkaIntegrationHelper

* Fix Consume(TimeSpan)

* Add await on the async Produce original call

* Fix signature for Produce

* Fix typo in class name

* Fix typo in class name

* Add await to ProduceAsync in sample app

* Add partition to Producer tags

* Improve sample and docker-compose.yml

* Kafka Sample on Fx and increase delaty to consume

* Fix ProduceAsync return and changes to Produce(Async) path

* Add offset to tags

* Fix Kafka sample app

* Add exception handling in kafka headers adapter

* Add client name and group id as tags

* Fix sample app not to display the error when the status is not in the error state

* Add exception logging in kafka headers adapter

* Initial changes to Confluent.Kafka Consumer

* Check if already instrumented plus small cleanup

* Smal opt.: avoid get method info for every header wrapper

* Fix if to avoid null reference exception

* Apply minor refactoring to sample app

* Add group id and client name tags

* Fix incorrect if causing context not to be passed

* Move produce and consume specific methods out of generic KafkaHelper

* PR feedback

* Avoid creating tags for empty strings

Co-authored-by: Paulo Janotti <[email protected]>
Co-authored-by: Robert Pająk <[email protected]>

Co-authored-by: Robert Pająk <[email protected]>
Co-authored-by: Dawid Szmigielski <[email protected]>
  • Loading branch information
3 people authored Jul 6, 2021
1 parent 24fd7b6 commit f557b12
Show file tree
Hide file tree
Showing 31 changed files with 1,815 additions and 54 deletions.
56 changes: 16 additions & 40 deletions Datadog.Trace.sln
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Samples.AspNetMvc5_0", "sam
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Datadog.Trace.AspNet", "src\Datadog.Trace.AspNet\Datadog.Trace.AspNet.csproj", "{B34EDBC7-C5FB-409D-8472-BC7469D6F2BD}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.TracingWithoutLimits", "samples\Samples.TracingWithoutLimits\Samples.TracingWithoutLimits.csproj", "{8BDF1DE0-E6DE-48AD-AAA3-CE09CB544E2C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.RateLimiter", "samples\Samples.RateLimiter\Samples.RateLimiter.csproj", "{EF718502-7760-45B5-A563-5F1B22A6B840}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.AspNetCoreMvc30", "samples\Samples.AspNetCoreMvc30\Samples.AspNetCoreMvc30.csproj", "{8B457E8F-8716-4F29-BBE2-DD6C7BC4AC37}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.AspNetCoreMvc31", "samples\Samples.AspNetCoreMvc31\Samples.AspNetCoreMvc31.csproj", "{303F8E41-691F-4453-AB7D-88A0036C0465}"
Expand Down Expand Up @@ -312,16 +308,16 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "linux", "linux", "{7DB68365
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Datadog.Trace.ClrProfiler.Managed.Core", "src\Datadog.Trace.ClrProfiler.Managed.Core\Datadog.Trace.ClrProfiler.Managed.Core.csproj", "{D95D5E26-F32A-481D-A15A-EF7B3B56D2E0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DogStatsD.RaceCondition", "reproductions\DogStatsD.RaceCondition\DogStatsD.RaceCondition.csproj", "{AAD9038B-8F16-4E09-93AF-B13E9F7ACD66}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.OpenTracing", "samples\Samples.OpenTracing\Samples.OpenTracing.csproj", "{62DBF34B-C5A6-46E6-8967-AFC275D4ECAA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Samples.Elasticsearch.V7", "samples\Samples.Elasticsearch.V7\Samples.Elasticsearch.V7.csproj", "{61D3E6DE-3EB0-49C4-B3B4-FAF589DCA5C0}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.Elasticsearch.V7", "samples\Samples.Elasticsearch.V7\Samples.Elasticsearch.V7.csproj", "{61D3E6DE-3EB0-49C4-B3B4-FAF589DCA5C0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.HttpMessageHandler", "samples\Samples.HttpMessageHandler\Samples.HttpMessageHandler.csproj", "{2F3B6271-B9A3-48A3-9DB6-847F3EF41F0A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.WebRequest", "samples\Samples.WebRequest\Samples.WebRequest.csproj", "{ED2742D3-2AA3-4D62-BB63-CFA43CEACCF3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Samples.Kafka", "samples\Samples.Kafka\Samples.Kafka.csproj", "{B7AF50AE-07B0-40F5-B395-1176852BBBA7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -938,26 +934,6 @@ Global
{B34EDBC7-C5FB-409D-8472-BC7469D6F2BD}.Release|x64.Build.0 = Release|Any CPU
{B34EDBC7-C5FB-409D-8472-BC7469D6F2BD}.Release|x86.ActiveCfg = Release|Any CPU
{B34EDBC7-C5FB-409D-8472-BC7469D6F2BD}.Release|x86.Build.0 = Release|Any CPU
{8BDF1DE0-E6DE-48AD-AAA3-CE09CB544E2C}.Debug|Any CPU.ActiveCfg = Debug|x86
{8BDF1DE0-E6DE-48AD-AAA3-CE09CB544E2C}.Debug|x64.ActiveCfg = Debug|x64
{8BDF1DE0-E6DE-48AD-AAA3-CE09CB544E2C}.Debug|x64.Build.0 = Debug|x64
{8BDF1DE0-E6DE-48AD-AAA3-CE09CB544E2C}.Debug|x86.ActiveCfg = Debug|x86
{8BDF1DE0-E6DE-48AD-AAA3-CE09CB544E2C}.Debug|x86.Build.0 = Debug|x86
{8BDF1DE0-E6DE-48AD-AAA3-CE09CB544E2C}.Release|Any CPU.ActiveCfg = Release|x86
{8BDF1DE0-E6DE-48AD-AAA3-CE09CB544E2C}.Release|x64.ActiveCfg = Release|x64
{8BDF1DE0-E6DE-48AD-AAA3-CE09CB544E2C}.Release|x64.Build.0 = Release|x64
{8BDF1DE0-E6DE-48AD-AAA3-CE09CB544E2C}.Release|x86.ActiveCfg = Release|x86
{8BDF1DE0-E6DE-48AD-AAA3-CE09CB544E2C}.Release|x86.Build.0 = Release|x86
{EF718502-7760-45B5-A563-5F1B22A6B840}.Debug|Any CPU.ActiveCfg = Debug|x86
{EF718502-7760-45B5-A563-5F1B22A6B840}.Debug|x64.ActiveCfg = Debug|x64
{EF718502-7760-45B5-A563-5F1B22A6B840}.Debug|x64.Build.0 = Debug|x64
{EF718502-7760-45B5-A563-5F1B22A6B840}.Debug|x86.ActiveCfg = Debug|x86
{EF718502-7760-45B5-A563-5F1B22A6B840}.Debug|x86.Build.0 = Debug|x86
{EF718502-7760-45B5-A563-5F1B22A6B840}.Release|Any CPU.ActiveCfg = Release|x86
{EF718502-7760-45B5-A563-5F1B22A6B840}.Release|x64.ActiveCfg = Release|x64
{EF718502-7760-45B5-A563-5F1B22A6B840}.Release|x64.Build.0 = Release|x64
{EF718502-7760-45B5-A563-5F1B22A6B840}.Release|x86.ActiveCfg = Release|x86
{EF718502-7760-45B5-A563-5F1B22A6B840}.Release|x86.Build.0 = Release|x86
{8B457E8F-8716-4F29-BBE2-DD6C7BC4AC37}.Debug|Any CPU.ActiveCfg = Debug|x86
{8B457E8F-8716-4F29-BBE2-DD6C7BC4AC37}.Debug|x64.ActiveCfg = Debug|x64
{8B457E8F-8716-4F29-BBE2-DD6C7BC4AC37}.Debug|x64.Build.0 = Debug|x64
Expand Down Expand Up @@ -1132,16 +1108,6 @@ Global
{D95D5E26-F32A-481D-A15A-EF7B3B56D2E0}.Release|x64.Build.0 = Release|Any CPU
{D95D5E26-F32A-481D-A15A-EF7B3B56D2E0}.Release|x86.ActiveCfg = Release|Any CPU
{D95D5E26-F32A-481D-A15A-EF7B3B56D2E0}.Release|x86.Build.0 = Release|Any CPU
{AAD9038B-8F16-4E09-93AF-B13E9F7ACD66}.Debug|Any CPU.ActiveCfg = Debug|x86
{AAD9038B-8F16-4E09-93AF-B13E9F7ACD66}.Debug|x64.ActiveCfg = Debug|x64
{AAD9038B-8F16-4E09-93AF-B13E9F7ACD66}.Debug|x64.Build.0 = Debug|x64
{AAD9038B-8F16-4E09-93AF-B13E9F7ACD66}.Debug|x86.ActiveCfg = Debug|x86
{AAD9038B-8F16-4E09-93AF-B13E9F7ACD66}.Debug|x86.Build.0 = Debug|x86
{AAD9038B-8F16-4E09-93AF-B13E9F7ACD66}.Release|Any CPU.ActiveCfg = Release|x86
{AAD9038B-8F16-4E09-93AF-B13E9F7ACD66}.Release|x64.ActiveCfg = Release|x64
{AAD9038B-8F16-4E09-93AF-B13E9F7ACD66}.Release|x64.Build.0 = Release|x64
{AAD9038B-8F16-4E09-93AF-B13E9F7ACD66}.Release|x86.ActiveCfg = Release|x86
{AAD9038B-8F16-4E09-93AF-B13E9F7ACD66}.Release|x86.Build.0 = Release|x86
{62DBF34B-C5A6-46E6-8967-AFC275D4ECAA}.Debug|Any CPU.ActiveCfg = Debug|x86
{62DBF34B-C5A6-46E6-8967-AFC275D4ECAA}.Debug|x64.ActiveCfg = Debug|x64
{62DBF34B-C5A6-46E6-8967-AFC275D4ECAA}.Debug|x64.Build.0 = Debug|x64
Expand Down Expand Up @@ -1184,6 +1150,18 @@ Global
{ED2742D3-2AA3-4D62-BB63-CFA43CEACCF3}.Release|x64.Build.0 = Release|x64
{ED2742D3-2AA3-4D62-BB63-CFA43CEACCF3}.Release|x86.ActiveCfg = Release|x86
{ED2742D3-2AA3-4D62-BB63-CFA43CEACCF3}.Release|x86.Build.0 = Release|x86
{B7AF50AE-07B0-40F5-B395-1176852BBBA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B7AF50AE-07B0-40F5-B395-1176852BBBA7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B7AF50AE-07B0-40F5-B395-1176852BBBA7}.Debug|x64.ActiveCfg = Debug|x64
{B7AF50AE-07B0-40F5-B395-1176852BBBA7}.Debug|x64.Build.0 = Debug|x64
{B7AF50AE-07B0-40F5-B395-1176852BBBA7}.Debug|x86.ActiveCfg = Debug|x86
{B7AF50AE-07B0-40F5-B395-1176852BBBA7}.Debug|x86.Build.0 = Debug|x86
{B7AF50AE-07B0-40F5-B395-1176852BBBA7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B7AF50AE-07B0-40F5-B395-1176852BBBA7}.Release|Any CPU.Build.0 = Release|Any CPU
{B7AF50AE-07B0-40F5-B395-1176852BBBA7}.Release|x64.ActiveCfg = Release|x64
{B7AF50AE-07B0-40F5-B395-1176852BBBA7}.Release|x64.Build.0 = Release|x64
{B7AF50AE-07B0-40F5-B395-1176852BBBA7}.Release|x86.ActiveCfg = Release|x86
{B7AF50AE-07B0-40F5-B395-1176852BBBA7}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -1247,8 +1225,6 @@ Global
{E41C87E9-7339-4FC0-8791-D57752C5BC12} = {CD9D9813-A195-464A-A0F1-59E02D16E181}
{D0424A27-4ED4-406E-80D5-2EFDCC53399B} = {65DF5743-B7B5-4BC8-8AB5-9DE596AF3FB8}
{B34EDBC7-C5FB-409D-8472-BC7469D6F2BD} = {9E5F0022-0A50-40BF-AC6A-C3078585ECAB}
{8BDF1DE0-E6DE-48AD-AAA3-CE09CB544E2C} = {AA6F5582-3B71-49AC-AA39-8F7815AC46BE}
{EF718502-7760-45B5-A563-5F1B22A6B840} = {AA6F5582-3B71-49AC-AA39-8F7815AC46BE}
{8B457E8F-8716-4F29-BBE2-DD6C7BC4AC37} = {AA6F5582-3B71-49AC-AA39-8F7815AC46BE}
{303F8E41-691F-4453-AB7D-88A0036C0465} = {AA6F5582-3B71-49AC-AA39-8F7815AC46BE}
{D141BD06-DD95-4CAF-85CD-657116E0DAD4} = {AA6F5582-3B71-49AC-AA39-8F7815AC46BE}
Expand All @@ -1265,11 +1241,11 @@ Global
{C41023C9-65C3-4FB3-9053-4DE963A81500} = {550AE553-2BBB-4021-B55A-137EF31A6B1F}
{7E563BF6-47F2-4531-A1CE-FB9445DF3253} = {AA6F5582-3B71-49AC-AA39-8F7815AC46BE}
{D95D5E26-F32A-481D-A15A-EF7B3B56D2E0} = {9E5F0022-0A50-40BF-AC6A-C3078585ECAB}
{AAD9038B-8F16-4E09-93AF-B13E9F7ACD66} = {550AE553-2BBB-4021-B55A-137EF31A6B1F}
{62DBF34B-C5A6-46E6-8967-AFC275D4ECAA} = {AA6F5582-3B71-49AC-AA39-8F7815AC46BE}
{61D3E6DE-3EB0-49C4-B3B4-FAF589DCA5C0} = {AA6F5582-3B71-49AC-AA39-8F7815AC46BE}
{2F3B6271-B9A3-48A3-9DB6-847F3EF41F0A} = {AA6F5582-3B71-49AC-AA39-8F7815AC46BE}
{ED2742D3-2AA3-4D62-BB63-CFA43CEACCF3} = {AA6F5582-3B71-49AC-AA39-8F7815AC46BE}
{B7AF50AE-07B0-40F5-B395-1176852BBBA7} = {AA6F5582-3B71-49AC-AA39-8F7815AC46BE}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {160A1D00-1F5B-40F8-A155-621B4459D78F}
Expand Down
30 changes: 30 additions & 0 deletions PackageVersionsComprehensive.g.props
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,36 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely
<PackageVersionSample Include="samples*\**\Samples.Elasticsearch.V5.csproj">
<Properties>ApiVersion=5.6.6;RestoreRecursive=false;BuildProjectReferences=false</Properties>
</PackageVersionSample>
<PackageVersionSample Include="samples*\**\Samples.Kafka.csproj">
<Properties>ApiVersion=1.4.3;RestoreRecursive=false;BuildProjectReferences=false</Properties>
</PackageVersionSample>
<PackageVersionSample Include="samples*\**\Samples.Kafka.csproj">
<Properties>ApiVersion=1.4.4;RestoreRecursive=false;BuildProjectReferences=false</Properties>
</PackageVersionSample>
<PackageVersionSample Include="samples*\**\Samples.Kafka.csproj">
<Properties>ApiVersion=1.5.0;RestoreRecursive=false;BuildProjectReferences=false</Properties>
</PackageVersionSample>
<PackageVersionSample Include="samples*\**\Samples.Kafka.csproj">
<Properties>ApiVersion=1.5.1;RestoreRecursive=false;BuildProjectReferences=false</Properties>
</PackageVersionSample>
<PackageVersionSample Include="samples*\**\Samples.Kafka.csproj">
<Properties>ApiVersion=1.5.2;RestoreRecursive=false;BuildProjectReferences=false</Properties>
</PackageVersionSample>
<PackageVersionSample Include="samples*\**\Samples.Kafka.csproj">
<Properties>ApiVersion=1.5.3;RestoreRecursive=false;BuildProjectReferences=false</Properties>
</PackageVersionSample>
<PackageVersionSample Include="samples*\**\Samples.Kafka.csproj">
<Properties>ApiVersion=1.6.1;RestoreRecursive=false;BuildProjectReferences=false</Properties>
</PackageVersionSample>
<PackageVersionSample Include="samples*\**\Samples.Kafka.csproj">
<Properties>ApiVersion=1.6.2;RestoreRecursive=false;BuildProjectReferences=false</Properties>
</PackageVersionSample>
<PackageVersionSample Include="samples*\**\Samples.Kafka.csproj">
<Properties>ApiVersion=1.6.3;RestoreRecursive=false;BuildProjectReferences=false</Properties>
</PackageVersionSample>
<PackageVersionSample Include="samples*\**\Samples.Kafka.csproj">
<Properties>ApiVersion=1.7.0;RestoreRecursive=false;BuildProjectReferences=false</Properties>
</PackageVersionSample>
<PackageVersionSample Include="samples*\**\Samples.Npgsql.csproj">
<Properties>ApiVersion=4.0.0;RestoreRecursive=false;BuildProjectReferences=false</Properties>
</PackageVersionSample>
Expand Down
7 changes: 7 additions & 0 deletions PackageVersionsGeneratorDefinitions.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@
"MinVersion": "5.3.0",
"MaxVersionExclusive": "6.0.0"
},
{
"IntegrationName": "Kafka",
"SampleProjectName": "Samples.Kafka",
"NugetPackageSearchName": "Confluent.Kafka",
"MinVersion": "1.4.3",
"MaxVersionExclusive": "2.0.0"
},
{
"IntegrationName": "Npgsql",
"SampleProjectName": "Samples.Npgsql",
Expand Down
12 changes: 12 additions & 0 deletions PackageVersionsLatestMinors.g.props
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,18 @@ NOTE: This code was generated by the GeneratePackageVersions tool. To safely
<PackageVersionSample Include="samples*\**\Samples.Elasticsearch.V5.csproj">
<Properties>ApiVersion=5.6.6;RestoreRecursive=false;BuildProjectReferences=false</Properties>
</PackageVersionSample>
<PackageVersionSample Include="samples*\**\Samples.Kafka.csproj">
<Properties>ApiVersion=1.4.4;RestoreRecursive=false;BuildProjectReferences=false</Properties>
</PackageVersionSample>
<PackageVersionSample Include="samples*\**\Samples.Kafka.csproj">
<Properties>ApiVersion=1.5.3;RestoreRecursive=false;BuildProjectReferences=false</Properties>
</PackageVersionSample>
<PackageVersionSample Include="samples*\**\Samples.Kafka.csproj">
<Properties>ApiVersion=1.6.3;RestoreRecursive=false;BuildProjectReferences=false</Properties>
</PackageVersionSample>
<PackageVersionSample Include="samples*\**\Samples.Kafka.csproj">
<Properties>ApiVersion=1.7.0;RestoreRecursive=false;BuildProjectReferences=false</Properties>
</PackageVersionSample>
<PackageVersionSample Include="samples*\**\Samples.Npgsql.csproj">
<Properties>ApiVersion=4.0.12;RestoreRecursive=false;BuildProjectReferences=false</Properties>
</PackageVersionSample>
Expand Down
39 changes: 39 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,26 @@ services:
ports:
- "127.0.0.1:8585:8585"

zookeeper:
image: confluentinc/cp-zookeeper:6.2.0
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ports:
- 2181:2181

# based on: https://docs.confluent.io/platform/current/installation/docker/config-reference.html
kafka:
image: confluentinc/cp-kafka:latest
depends_on:
- zookeeper
ports:
- 29092:29092
environment:
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092,PLAINTEXT_HOST://localhost:29092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1

build:
build:
context: ./
Expand Down Expand Up @@ -231,6 +251,17 @@ services:
depends_on:
- mongo

Samples.Kafka:
build:
context: ./
dockerfile: ./docker/dotnet.dockerfile
image: datadog-dotnet
command: bash -c "/project/docker/with-profiler-logs.bash wait-for-it kafka:9092 -- /project/docker/with-profiler.bash dotnet /project/samples/Samples.Kafka/bin/${buildConfiguration}/${publishTargetFramework}/publish/Samples.Kafka.dll"
volumes:
- ./:/project
depends_on:
- kafka

# .NET Core does not have apk packages for .NET Core runtimes, they only have base images
# Until it's resolved, have a separate Dockerfile for each runtime
# (see: https://github.com/dotnet/runtime/issues/3406)
Expand All @@ -253,6 +284,7 @@ services:
- POSTGRES_HOST=postgres
- MYSQL_HOST=mysql
- MYSQL_PORT=3306
- KAFKA_HOST=kafka:9092
- buildConfiguration=${buildConfiguration}
- publishTargetFramework=netcoreapp2.1
depends_on:
Expand All @@ -265,6 +297,7 @@ services:
- mongo
- postgres
- mysql
- kafka

IntegrationTests.Alpine.Core30:
build:
Expand All @@ -285,6 +318,7 @@ services:
- POSTGRES_HOST=postgres
- MYSQL_HOST=mysql
- MYSQL_PORT=3306
- KAFKA_HOST=kafka:9092
- buildConfiguration=${buildConfiguration}
- publishTargetFramework=netcoreapp3.0
depends_on:
Expand All @@ -297,6 +331,7 @@ services:
- mongo
- postgres
- mysql
- kafka

IntegrationTests.Alpine.Core31:
build:
Expand All @@ -317,6 +352,7 @@ services:
- POSTGRES_HOST=postgres
- MYSQL_HOST=mysql
- MYSQL_PORT=3306
- KAFKA_HOST=kafka:9092
- buildConfiguration=${buildConfiguration}
- publishTargetFramework=netcoreapp3.1
depends_on:
Expand All @@ -329,6 +365,7 @@ services:
- mongo
- postgres
- mysql
- kafka

IntegrationTests.Alpine.Core50:
build:
Expand Down Expand Up @@ -381,6 +418,7 @@ services:
- POSTGRES_HOST=postgres
- MYSQL_HOST=mysql
- MYSQL_PORT=3306
- KAFKA_HOST=kafka:9092
- buildConfiguration=${buildConfiguration}
- publishTargetFramework=${publishTargetFramework}
depends_on:
Expand All @@ -393,3 +431,4 @@ services:
- mongo
- postgres
- mysql
- kafka
1 change: 1 addition & 0 deletions docker/Datadog.Trace.ClrProfiler.IntegrationTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ docker/with-profiler-logs.bash \
wait-for-it sqlserver:1433 -- \
wait-for-it mongo:27017 -- \
wait-for-it postgres:5432 -- \
wait-for-it kafka:9092 -- \
dotnet vstest test/Datadog.Trace.ClrProfiler.IntegrationTests/bin/$buildConfiguration/$publishTargetFramework/publish/Datadog.Trace.ClrProfiler.IntegrationTests.dll --logger:trx --ResultsDirectory:test/Datadog.Trace.ClrProfiler.IntegrationTests/results
2 changes: 1 addition & 1 deletion docker/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ then
dotnet publish -f $publishTargetFramework -c $buildConfiguration samples/Samples.AdditionalDiagnosticListeners/Samples.AdditionalDiagnosticListeners.csproj -p:Configuration=$buildConfiguration -p:ManagedProfilerOutputDirectory="$PUBLISH_OUTPUT"
fi

for sample in Samples.Elasticsearch.V7 Samples.Elasticsearch Samples.Elasticsearch.V5 Samples.ServiceStack.Redis Samples.StackExchange.Redis Samples.SqlServer Samples.MongoDB Samples.HttpMessageHandler Samples.WebRequest Samples.Npgsql Samples.MySql Samples.GraphQL Samples.FakeKudu Samples.Dapper Samples.OpenTracing ; do
for sample in Samples.Elasticsearch.V7 Samples.Elasticsearch Samples.Elasticsearch.V5 Samples.ServiceStack.Redis Samples.StackExchange.Redis Samples.SqlServer Samples.MongoDB Samples.HttpMessageHandler Samples.WebRequest Samples.Npgsql Samples.MySql Samples.GraphQL Samples.FakeKudu Samples.Dapper Samples.Kafka Samples.OpenTracing ; do
dotnet publish -f $publishTargetFramework -c $buildConfiguration samples/$sample/$sample.csproj -p:Configuration=$buildConfiguration -p:ManagedProfilerOutputDirectory="$PUBLISH_OUTPUT"
done

Expand Down
Loading

0 comments on commit f557b12

Please sign in to comment.