Skip to content

Commit

Permalink
feat: Add support for OpenAI client library for .NET (#2987)
Browse files Browse the repository at this point in the history
  • Loading branch information
tippmar-nr authored Feb 12, 2025
1 parent 8e53512 commit aa06d9d
Show file tree
Hide file tree
Showing 33 changed files with 1,671 additions and 285 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
{
"packageName": "awssdk.dynamodbv2"
},
{
"packageName": "azure.ai.openai"
},
{
"packageName": "confluent.kafka"
},
Expand Down Expand Up @@ -123,6 +126,9 @@
"ignoreTFMs": "net481",
"ignoreReason": "net481 doesn't support v9.x"
},
{
"packageName": "openai"
},
{
"packageName": "opensearch.client"
},
Expand Down
10 changes: 9 additions & 1 deletion FullAgent.sln
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Home", "src\Agent\NewRelic\
{0DC126D1-E782-4A41-BA3E-393083F08627} = {0DC126D1-E782-4A41-BA3E-393083F08627}
{10B2665A-B898-49F7-8BCA-2511872B0902} = {10B2665A-B898-49F7-8BCA-2511872B0902}
{1593CA23-F7EC-42F2-A915-F5D5B18F8C6B} = {1593CA23-F7EC-42F2-A915-F5D5B18F8C6B}
{1B7804AF-5D4D-4049-96EF-A4786B6B9432} = {1B7804AF-5D4D-4049-96EF-A4786B6B9432}
{203A8EA4-A0F2-4139-B02E-9B0F2B39C107} = {203A8EA4-A0F2-4139-B02E-9B0F2B39C107}
{22274460-3222-4474-B679-19E1F27A2CC3} = {22274460-3222-4474-B679-19E1F27A2CC3}
{230CDE78-9D21-4D10-9C4B-E00C88B8B021} = {230CDE78-9D21-4D10-9C4B-E00C88B8B021}
Expand Down Expand Up @@ -223,6 +224,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PublicApiChangeTests", "tes
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Memcached", "src\Agent\NewRelic\Agent\Extensions\Providers\Wrapper\Memcached\Memcached.csproj", "{5D74E5C5-9BA3-423B-86F7-14C2D1A14661}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenAI", "src\Agent\NewRelic\Agent\Extensions\Providers\Wrapper\OpenAI\OpenAI.csproj", "{1B7804AF-5D4D-4049-96EF-A4786B6B9432}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenSearch", "src\Agent\NewRelic\Agent\Extensions\Providers\Wrapper\OpenSearch\OpenSearch.csproj", "{EC27FFD7-FAE4-4882-95C4-D3FA60F738BD}"
EndProject
Global
Expand Down Expand Up @@ -471,6 +474,10 @@ Global
{5D74E5C5-9BA3-423B-86F7-14C2D1A14661}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5D74E5C5-9BA3-423B-86F7-14C2D1A14661}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5D74E5C5-9BA3-423B-86F7-14C2D1A14661}.Release|Any CPU.Build.0 = Release|Any CPU
{1B7804AF-5D4D-4049-96EF-A4786B6B9432}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1B7804AF-5D4D-4049-96EF-A4786B6B9432}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1B7804AF-5D4D-4049-96EF-A4786B6B9432}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1B7804AF-5D4D-4049-96EF-A4786B6B9432}.Release|Any CPU.Build.0 = Release|Any CPU
{EC27FFD7-FAE4-4882-95C4-D3FA60F738BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EC27FFD7-FAE4-4882-95C4-D3FA60F738BD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EC27FFD7-FAE4-4882-95C4-D3FA60F738BD}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -546,11 +553,12 @@ Global
{338AD83A-ED68-438A-8FB1-E93A3AE87EA8} = {5E86E10A-C38F-48CB-ADE9-67B22BB2F50A}
{A8F6EFEA-1C31-4461-A7B4-25C30D954EE2} = {E5B988C0-5D19-407E-8210-71FFB90C579A}
{5D74E5C5-9BA3-423B-86F7-14C2D1A14661} = {5E86E10A-C38F-48CB-ADE9-67B22BB2F50A}
{1B7804AF-5D4D-4049-96EF-A4786B6B9432} = {5E86E10A-C38F-48CB-ADE9-67B22BB2F50A}
{EC27FFD7-FAE4-4882-95C4-D3FA60F738BD} = {5E86E10A-C38F-48CB-ADE9-67B22BB2F50A}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D8B98070-6B8E-403C-A07F-A3F2E4A3A3D0}
EnterpriseLibraryConfigurationToolBinariesPath = packages\Unity.2.1.505.2\lib\NET35
SolutionGuid = {D8B98070-6B8E-403C-A07F-A3F2E4A3A3D0}
EndGlobalSection
GlobalSection(TestCaseManagementSettings) = postSolution
CategoryFile = FullAgent.vsmdi
Expand Down
10 changes: 6 additions & 4 deletions build/ArtifactBuilder/CoreAgentComponents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ protected override void CreateAgentComponents()
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.Kafka.dll",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.AspNetCore6Plus.dll",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.Bedrock.dll",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.OpenAI.dll",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.AwsLambda.dll",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.AwsSdk.dll",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.AzureFunction.dll",
Expand Down Expand Up @@ -85,6 +86,7 @@ protected override void CreateAgentComponents()
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.Kafka.Instrumentation.xml",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.AspNetCore6Plus.Instrumentation.xml",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.Bedrock.Instrumentation.xml",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.OpenAI.Instrumentation.xml",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.AwsLambda.Instrumentation.xml",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.AwsSdk.Instrumentation.xml",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.AzureFunction.Instrumentation.xml",
Expand Down Expand Up @@ -122,7 +124,7 @@ protected override void CreateAgentComponents()
NewRelicConfig,
NewRelicXsd
};

if (!string.IsNullOrWhiteSpace(WindowsProfiler))
{
agentHomeDirFiles.Add(WindowsProfiler);
Expand All @@ -142,11 +144,11 @@ protected override void CreateAgentComponents()
AgentApiDll = $@"{SourcePath}\..\_build\AnyCPU-{Configuration}\NewRelic.Api.Agent\netstandard2.0\NewRelic.Api.Agent.dll";

LinuxProfiler = null;
if (Platform == "x64")
if (Platform == "x64")
{
LinuxProfiler = $@"{HomeRootPath}\newrelichome_x64_coreclr_linux\libNewRelicProfiler.so";
}
else if (Platform == "arm64")
}
else if (Platform == "arm64")
{
LinuxProfiler = $@"{HomeRootPath}\newrelichome_arm64_coreclr_linux\libNewRelicProfiler.so";
}
Expand Down
2 changes: 2 additions & 0 deletions build/ArtifactBuilder/FrameworkAgentComponents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ protected override void CreateAgentComponents()
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.MassTransitLegacy.dll",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.Kafka.dll",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.Bedrock.dll",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.OpenAI.dll",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.AwsSdk.dll",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.AzureFunction.dll",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.Memcached.dll",
Expand Down Expand Up @@ -107,6 +108,7 @@ protected override void CreateAgentComponents()
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.MassTransitLegacy.Instrumentation.xml",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.Kafka.Instrumentation.xml",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.Bedrock.Instrumentation.xml",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.OpenAI.Instrumentation.xml",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.AwsSdk.Instrumentation.xml",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.AzureFunction.Instrumentation.xml",
$@"{SourceHomeBuilderPath}\extensions\NewRelic.Providers.Wrapper.Memcached.Instrumentation.xml",
Expand Down
Loading

0 comments on commit aa06d9d

Please sign in to comment.